numpy科学计算器库入门1 numpy的属性

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/zy_505775013/article/details/88668811
import numpy as np
array = np.array([[1,2,3],
                  [4,5,6],
                  [7,8,9]])
print(array)

[[1 2 3]
 [4 5 6]
 [7 8 9]]

print(array.ndim)#查看矩阵的维度

2

print(array.shape)#矩阵的形状 几行几列

(3, 3)

print(array.size)#矩阵元素的个数

9

print(array.dtype)#元素类型

int32

猜你喜欢

转载自blog.csdn.net/zy_505775013/article/details/88668811