import numpy a=numpy.arange(27).reshape(3,3,3) b=numpy.arange(12) c=numpy.reshape(b,(2,3,2)) #修改为三维数组 #将多维数组修改为一维数组 d=c.reshape(12) e=c.reshape(-1) #通过ravel,flatten,将多维数组转化为一维数组 f=c.ravel() g=c.flatten()
原文:https://www.cnblogs.com/luckiness/p/13156436.html