For each field, permute the axes of the data array.
By default the order of the axes is reversed, but any ordering may be specified by selecting the axes of the output in the required order.
For each field, the axes are selected with the axes parameter.
See also
Examples 1: |
---|
Reverse the order of the axes:
>>> g = f.transpose()
Specify a particular axes order:
>>> g = f.transpose(['T', 'X', 'Y'])
See also
Parameters: |
|
---|---|
Returns: |
|
Examples 2: |
>>> f.items()
{'dim0': <CF DimensionCoordinate: time(12) noleap>,
'dim1': <CF DimensionCoordinate: latitude(64) degrees_north>,
'dim2': <CF DimensionCoordinate: longitude(128) degrees_east>,
'dim3': <CF DimensionCoordinate: height(1) m>}
>>> f.data_axes()
['dim0', 'dim1', 'dim2']
>>> f.transpose()
>>> f.transpose(['latitude', 'time', 'longitude'])
>>> f.transpose([1, 0, 2])
>>> f.transpose((1, 'time', 'dim2'))