标签:属性 byte bsp 分享 range img png .com ber
多维数组的属性
import numpy as np arr1=np.arange(8) arr2=arr1.reshape(2,4) print(‘arr1:‘,arr1) print(‘arr2:‘,arr2) print(‘arr2[1,2:3]‘,arr2[1,2:3]) print(‘arr2[:,2]‘,arr2[:,2]) print(‘arr2[1][2:3]‘,arr2[1][2:3]) arr=arr2 print(‘Data type:‘,arr.dtype) print(‘Total number of elements:‘,arr.size) print(‘Number of dimensions:‘,arr.ndim) print(‘Shape (dimensionality):‘,arr.shape) print(‘Memory used (in bytes):‘,arr.nbytes)
标签:属性 byte bsp 分享 range img png .com ber
原文地址:https://www.cnblogs.com/wl2017/p/9531196.html