cf.Data.flip

Data.flip(axes=None)[source]

Flip (reverse the direction) axes of the data array in place.

Parameters :
axes : (sequence of) int or str, optional

Select the axes. By default all axes are flipped. The axes argument may be one, or a sequence, of:

  • An internal axis identifier. Selects this axis.
  • An integer. Selects the axis coresponding to the given position in the list of axes of the data array.

No axes are flipped if axes is an empty sequence.

Returns :
out : list of ints

The axes which were flipped, in arbitrary dimensions.

Examples

>>> d.flip()
>>> d.flip(1)
>>> d.flip([0, 1])
>>> e = d[::-1, :, ::-1]
>>> d.flip([2, 0]).equals(e)
True

Previous topic

cf.Data.flat

Next topic

cf.Data.func

This Page