Flip contents of axis in array arr
flip_axis is the same transform as np.flipud, but for any axis. For example flip_axis(arr, axis=0) is the same transform as np.flipud(arr), and flip_axis(arr, axis=1) is the same transform as np.fliplr(arr)
Parameters : | arr : array-like axis : int, optional
|
---|---|
Returns : | farr : array
|
Examples
>>> a = np.arange(6).reshape((2,3))
>>> a
array([[0, 1, 2],
[3, 4, 5]])
>>> flip_axis(a, axis=0)
array([[3, 4, 5],
[0, 1, 2]])
>>> flip_axis(a, axis=1)
array([[2, 1, 0],
[5, 4, 3]])