cf.Data.transpose

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

Permute the axes of the data array in place.

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.

i : bool, optional

If True then update the data array in place. By default a new data array is created.

Returns :

out : cf.Data

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)

Previous topic

cf.Data.to_memory

Next topic

cf.Data.var

This Page