numpy 属性

import numpy as np

array = np.array([[1,2,3],[2,3,4]])

print(array)
print('number of dim:',array.ndim)
print('shape:',array.shape)
print('size:',array.size)

result:

[[1 2 3]
 [2 3 4]]
number of dim: 2
shape: (2, 3)
size: 6

你可能感兴趣的:(numpy 属性)