numpy数组示例——1、数组的创建
示例代码如下: import numpy as np #numpy.array(object,dtype=None) a1=np.array([1,3,2,5,4],dtype=int)#一维 a2=np.array([[1,2,3,4,5,6],[3,5,7,9,11,13],[2,3,4,5,6,7]],dtype=int)#二维 a3=np.array([[[1,2,3],[2,3,4],[1,3,5]],[[3,4,5],[4,5,6],[2,4,6]],[[5,6,7],[6,7,8],[3,5,7]]],dtype=float)#三维 #numpy.zeros(shape,dt
用户评论