Numpy N-D rot90 flip

Rotating 3-D arrays in Python (and Matlab) is straightforward even for N-dimensional arrays.

rot90

Numpy rot90 rotates N-dimensional arrays clockwise (k positive) or counterclockwise (k negative).

numpy.rot90(data, k=2, axes=(1,2))

Matlab rot90 can also handle N-dimensional arrays, but doesn’t allow control over the rotated axes as Numpy does.

flip

Numpy flip works for N-dimensional arrays along the specified axis, just like Matlab flip.