cf.Data.transpose

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

Permute the axes of the data array.

See also

flatten', `insert_dimension, flip, squeeze, swapaxes

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 integer position.

inplace: bool, optional

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

i: deprecated at version 3.0.0

Use the inplace parameter instead.

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)