Permute the dimensions of an array.
Parameters: | a : array_like
axes : list of ints, optional
|
---|---|
Returns: | p : ndarray
|
See also
Examples
>>> x = np.arange(4).reshape((2,2))
>>> x
array([[0, 1],
[2, 3]])
>>> np.transpose(x)
array([[0, 2],
[1, 3]])
>>> x = np.ones((1, 2, 3))
>>> np.transpose(x, (1, 0, 2)).shape
(2, 1, 3)