赞
踩
当我们想要将二维数组转换为三维数组时
如下所示
def 2d23d(nums1,nums2):
b = np.reshape(nums1,(matlen,matlen,1))#将二维矩阵转为一层的三维矩阵
c = np.reshape(nums2,(matlen,matlen,1))
ret = np.concatenate([b,c],2)#将两个三维矩阵按照第三轴叠加
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。