numpy.transpose

The official document: https://docs.scipy.org/doc/numpy/reference/generated/numpy.transpose.html

For two-dimensional ndarray, transpose parameter is not specified default is the matrix transpose. If the specified parameters, the corresponding results are as follows:

x.transpose((0,1))
array([[0, 1],
       [2, 3]])

  

x.transpose((1,0))
array([[0, 2],
       [1, 3]])

  

Guess you like

Origin www.cnblogs.com/lyl0618/p/12655844.html