cf.Field.transpose

Field.transpose(axes=None, **kwargs)[source]

Permute the dimensions of the data array in place.

Parameters :
axes, kwargs : optional

Set the new axis order. By default the existing axis order is reversed.

If axes and/or kwargs are set then the new axis order is that which would be returned by this call of the field’s axes method: f.axes(axes, ordered=True, **kwargs). See cf.Field.axes for details.

Returns :

None

Examples

>>> f.ndim
3
>>> f.transpose()
>>> f.transpose(['latitude', 'time', 'longitude'])
>>> f.transpose([1, 0, 2])
>>> f.transpose((1, 'time', 'dim2'))

Previous topic

cf.Field.transforms

Next topic

cf.Field.unsqueeze

This Page