import numpy as np
array = np.array([
[1, 2, 3],
[4, 5, 6]
])
print(array)
print('number of dim:',array.ndim)
print('shape:', array.shape)
print('size:', array.size)
结果
[[1 2 3]
[4 5 6]]
number of dim: 2
shape: (2, 3)
size: 6