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

Permute the axes of the data array.

New in version (cfdm): 1.7.0

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:


Parameter example:


Parameter example:

axes=[1, -2]

constructs: bool

If True then transpose the metadata constructs to have the same relative domain axis order as the data of transposed field construct. By default, metadata constructs are not changed.

inplace: bool, optional

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

Field or None

The field construct with permuted data axes. If the operation was in-place then None is returned.


(19, 73, 96)
>>> f.transpose().data.shape
(96, 73, 19)
>>> f.transpose([1, 0, 2]).data.shape
(73, 19, 96)
>>> f.transpose(inplace=True)
(96, 19, 73)