2021
03-23
03-23
numpy的squeeze函数使用方法
reshape函数:改变数组的维数(注意不是shape大小)>>>e=np.arange(10)>>>earray([0,1,2,3,4,5,6,7,8,9])>>>e.reshape(1,1,10)array([[[0,1,2,3,4,5,6,7,8,9]]])>>>e.reshape(1,1,10)array([[[0,1,2,3,4,5,6,7,8,9]]])>>>e.reshape(1,10,1)array([[[0],[1],[2],[3],[4],[5],[6],[7],[8],[9]]])squeeze函数:从数组的形状中删除单维度条目,即把shape中为1...
继续阅读 >