cf.Data.transpose

Data.transpose(axes=None)[source]

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:

  • The integer position of a dimension in the data array.
  • The internal name a dimension.
Returns :
out : list of ints

The axes which were transposed

Examples

>>> d.ndim
3
>>> d.transpose()
>>> d.transpose([1, 0, 2])
>>> d.transpose(['dim2', 'dim0', 'dim1'])
>>> d.transpose((1, 0, 'dim2'))

Previous topic

cf.Data.to_memory

Next topic

cf.Data.add_partitions

This Page