numpy 数组 维度 大小 形状

import numpy as np 
a1 = np.arange(0,6).reshape(2,3)
print(a1)
[[0 1 2]
 [3 4 5]]
print('数组维度:',a1.ndim)
数组维度: 2
print('数组大小:', a1.size)
数组大小: 6
print('数组形状:', a1.shape)
数组形状: (2, 3)

猜你喜欢

转载自blog.csdn.net/weixin_44493841/article/details/121491262