cfdm.AuxiliaryCoordinate.transpose¶
-
AuxiliaryCoordinate.
transpose
(*args, **kwargs)[source]¶ Permute the axes of the data array.
Corresponding axes of the bounds data array, if present, are also permuted.
Note that if i) the data array is two-dimensional, ii) the two axes have been permuted, and iii) each cell has four bounds values; then columns 1 and 3 (counting from 0) of the bounds axis are swapped to preserve contiguity bounds in adjacent cells. See section 7.1 “Cell Boundaries” of the CF conventions for details.
See also
- Parameters
- axes: (sequence of)
int
, optional The new axis order. By default the order is reversed.
Each axis is identified by its integer position in the data. Negative integers counting from the last position are allowed.
- Parameter example:
axes=0
- Parameter example:
axes=-1
- Parameter example:
axes=[1, -2]
- inplace:
bool
, optional If True then do the operation in-place and return
None
.
- axes: (sequence of)
- Returns
AuxiliaryCoordinate
orNone
The new construct with permuted data axes. If the operation was in-place then
None
is returned.
Examples
>>> f.shape (19, 73, 96) >>> f.transpose().shape (96, 73, 19) >>> g = f.transpose([1, 0, 2]) >>> g.shape (73, 19, 96) >>> f.bounds.shape (19, 73, 96, 4) >>> g.bounds.shape (73, 19, 96, 4)