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]
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章