cf.Field.transpose

Field.transpose(axes=None)

Permute the dimensions of the data array in place.

Parameters :
axes : sequence, optional

The new order of the data array. By default, reverse the dimensions’ order, otherwise the axes are permuted according to the values given. The values of the sequence may be any combination of:

  • A dimension’s standard name.
  • The integer position of a dimension in the data array.
  • The field’s space’s internal name of a dimension
Returns :

None

Examples

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

Previous topic

cf.Field.squeeze

Next topic

cf.Field.unsqueeze

This Page