def rot90(m, k=1, axis=2):
    """Rotate an array by 90 degrees in the counter-clockwise direction around the given axis"""
m = numpy.swapaxes(m, 2, axis)
m = numpy.rot90(m, k)
m = numpy.swapaxes(m, 2, axis)
return m
How to calculate all 24 rotations of 3d array?