cfdm.Data.transpose

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

Permute the axes of the data array.

New in version (cfdm): 1.7.0

See also

flatten', `insert_dimension, squeeze

Parameters
axes: (sequence of) int

The new axis order of the data array. By default the order is reversed. Each axis of the new order is identified by its original positive or negative integer position.

inplace: bool, optional

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

Returns

Data or None

Examples

>>> d.shape
(19, 73, 96)
>>> d.transpose()
>>> d.shape
(96, 73, 19)
>>> d.transpose([1, 0, 2])
>>> d.shape
(73, 96, 19)
>>> d.transpose((-1, 0, 1))
>>> d.shape
(19, 73, 96)