Python使用numpy獲取列表行數、列數

生成形狀爲3x3的二維整數數組

	a = np.random.randint(1, 100, (3, 3))
	
	[[50 90 85]
	 [83 58 53]
	 [85 71 92]]

Python使用numpy獲取列表行數、列數

	import numpy as np

	np.shape(csv_data)[0] // 行
	np.shape(csv_data)[1] // 列
	(m, n) = np.shape(csv_data)[0]
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章