ndarray对象属性

import  numpy

#创建一位数组
a=numpy.array([1,2,3,4])
b=numpy.arange(4,10)


#创建三维数组
c=numpy.random.randint(4,10,size=(3,3,4))



#ndarray属性
print(c.ndim)    # 返回维度
#shape属性
print(c.shape)   #打印行列数和维度
#dtype属性
print(c.dtype)
print(c.size)   #元祖里面的元素总和
#itemsize每个元素占的字节
print(c.itemsize)
原文地址:https://www.cnblogs.com/luckiness/p/13139367.html