Assume I have an array
>>> a
[[[0, 1, 2], [3, 4, 5], [6, 7, 8]], [[10, 11, 12], [13, 14, 15], [16, 17, 18]]]
that I want to flip around an axis to end up with
>>> aflipped
[[[2, 1, 0], [5, 4, 3], [8, 7, 6]], [[12, 11, 10], [15, 14, 13], [18, 17, 16]]]
I would like to do this with some kind of the
>>> aflipped=a[::-1][::1][::1]
or
>>>> aflipped=flipud(a)
notation, since I understand this is extremely fast and (important) low on memory usage. My code ends up swapping already, a for loop wouldn't bee ideal at all.
Actually this is a 4D array where I just want to flip one axis, but it seems my options are limited to the first two axis. Is there a memory efficient method to do so?