transpose
Returns an array with axes transposed.Input array.
If specified, it must be a tuple or list which contains a permutation of [0, 1, …, N-1] where N is the number of axes of
a. Negative indices can also be used. The i-th axis of the returned array will correspond to the axis numbered axes[i] of the input. If not specified, defaults to range(a.ndim)[::-1], which reverses the order of the axes.ndarray - a with its axes permuted. A view is returned whenever possible.
Examples
See Also
ndarray.T- Shorthand for transposemoveaxis- Move axes to new positionsswapaxes- Interchange two axes
ndarray.T
View of the transposed array.Examples
See Also
transpose- Permute the dimensions of an arrayndarray.transpose- Equivalent method with more options
swapaxes
Interchange two axes of an array.Input array.
First axis.
Second axis.
ndarray - A view of the array with axes swapped (when possible).
Examples
See Also
transpose- Permute axes of an arraymoveaxis- Move axes to new positions
moveaxis
Move axes of an array to new positions.The array whose axes should be reordered.
Original positions of the axes to move. These must be unique.
Destination positions for each of the original axes. These must also be unique.
ndarray - Array with moved axes. This array is a view of the input array.
Examples
See Also
transpose- Permute the dimensions of an arrayswapaxes- Interchange two axes of an array
