Understanding of swapaxes(a,x,y) method of Numpy library

The operation function of the ndarray object np.swapaxes(a,x,y) is
equivalent to a.swapaxes(x,y)

import numpy as np

a = np.arange(24).reshape((2,3,4))
generates the following array:

Method understanding:
a.swapaxes(x,y), is to swap the two dimensions in the n-dimensional array, where the value of x, y is the index value in the tuple of a.shape value (2, 3, 4) (below Mark).

 

Undertake programming in Matlab, Python and C++, machine learning, computer vision theory implementation and guidance, both undergraduate and master's degree, salted fish trading, professional answers please go to know, please contact QQ number 757160542 for details, if you are the one.

 

Guess you like

Origin blog.csdn.net/weixin_36670529/article/details/113817360