生成形状为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]
生成形状为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]