A CF-compliant earth science data analysis library
Bounds.
swapaxes
Interchange two axes of an array.
See also
flatten, flip, insert_dimension, squeeze, transpose
flatten
flip
insert_dimension
squeeze
transpose
int
Select the axes to swap. Each axis is identified by its original integer position.
bool
If True then do the operation in-place and return None.
None
Bounds
The construct with data with swapped axis positions. If the operation was in-place then None is returned.
Examples
>>> f.shape (1, 2, 3) >>> f.swapaxes(1, 0).shape (2, 1, 3) >>> f.swapaxes(0, -1).shape (3, 2, 1) >>> f.swapaxes(1, 1).shape (1, 2, 3) >>> f.swapaxes(-1, -1).shape (1, 2, 3)