flip

Contents

flip#

class saiunit.math.flip(m, axis=None, **kwargs)#

Reverse the order of elements in a quantity or an array along the given axis.

Parameters:
  • m (Array | saiunit.Quantity) – Input array.

  • axis (int | Tuple[int, ...] | None) – Axis or axes along which to flip over. The default, axis=None, will flip over all of the axes of the input array.

Returns:

res – A view of m with the entries of axis reversed. Since a view is returned, this operation is done in constant time.

Return type:

Array | saiunit.Quantity

Examples

>>> import saiunit as u
>>> a = [1, 2, 3] * u.meter
>>> u.math.flip(a)