flip#

rbc.stdlib.manipulation_functions.flip(x)#

Reverses the order of elements in an array along the given axis.

Examples

>>> import numpy as np
>>> from rbc.stdlib import array_api
>>> @heavydb('int16[](int16[])')
... def flip(x):
...     return array_api.flip(x)
>>> a = np.arange(4, dtype=np.int16)
>>> flip(a).execute()
array([3, 2, 1, 0], dtype=int16)
>>> b = np.arange(1, dtype=np.int16)
>>> flip(b).execute()
array([0], dtype=int16)

Array-API ‘flip’ doc