numpy 和 matlab 的 reshape


numpy


>>> import numpy as np
>>> a=np.array([1,2],[3,4])

array([[1, 2],
        [3, 4]])

>>> np.reshape(a,(1,4))

array([[1, 2, 3, 4]])


matlab


>> a=[1,2;3,4]

a =

     1     2
      3     4

>> reshape(a,1,4)

ans =

     1     3     2     4

原文地址:https://www.cnblogs.com/XUEYEYU/p/12915732.html