cf.CellMeasure.transpose

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

Permute the dimensions of the data array.

See also

expand_dims, flip, squeeze

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

Returns:

out : cf.Variable

Examples:
>>> f.shape
(2, 3, 4)
>>> f.transpose()
>>> f.shape
(4, 3, 2)
>>> f.transpose([1, 2, 0])
>>> f.shape
(3, 2, 4)
>>> f.transpose((1, 0, 2))
>>> f.shape
(2, 3, 4)

Previous topic

cf.CellMeasure.squeeze

Next topic

cf.CellMeasure.where

This Page