Field.flip(axes=None, inplace=False, i=False, **kwargs)[source]

Flip (reverse the direction of) axes of the field.

axes: (sequence of) str or int, optional

Select the domain axes to flip, defined by the domain axes that would be selected by passing each given axis description to a call of the field construct’s domain_axis method. For example, for a value of 'X', the domain axis construct returned by f.domain_axis('X') is selected.

If no axes are provided then all axes are flipped.

inplace: bool, optional

If True then do the operation in-place and return None.

i: deprecated at version 3.0.0

Use the inplace parameter instead.

kwargs: deprecated at version 3.0.0

Field or None

The field construct with flipped axes, or None if the operation was in-place.


>>> g = f.flip()
>>> g = f.flip('time')
>>> g = f.flip(1)
>>> g = f.flip(['time', 1, 'dim2'])
>>> f.flip(['dim2'], inplace=True)