cf.FieldAncillary.transpose

FieldAncillary.transpose(axes=None, inplace=False)[source]

Permute the axes of the data array.

New in version 1.7.0.

Parameters
axes: (sequence of) int

The new axis order. By default the order is reversed. Each axis in the new order is identified by its original integer position. Negative integers counting from the last position are allowed.

Parameter example:

axes=[2, 0, 1]

Parameter example:

axes=[-1, 0, 1]

inplace: bool, optional

If True then do the operation in-place and return None.

Returns

A new instance with permuted data axes. If the operation was in-place then None is returned.

Examples:

>>> f.shape
(19, 73, 96)
>>> f.tranpose().shape
(96, 73, 19)
>>> f.tranpose([1, 0, 2]).shape
(73, 19, 96)