cf.Field.flip¶
-
Field.
flip
(axes=None, inplace=False, i=False, **kwargs)[source]¶ Flip (reverse the direction of) axes of the field.
See also
domain_axis
,flatten
,insert_dimension
,squeeze
,transpose
,unsqueeze
- Parameters
- axes: (sequence of)
str
orint
, 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 byf.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
- axes: (sequence of)
- Returns
Examples:
>>> g = f.flip() >>> g = f.flip('time') >>> g = f.flip(1) >>> g = f.flip(['time', 1, 'dim2']) >>> f.flip(['dim2'], inplace=True)