arr = np.arange(16).reshape((2, 2, 4))
arr.strides
(32, 16, 4)
So, I believe from my knowledge that in memory it would be something like the image below. The strides are marked along with the axis (on the arrows).
And this is what I think I have after transposing one of the axes using the command:
arr.transpose((1, 0, 2))
I understand there is no changes in the memory block but I am not able to understand how exactly does the strides help in traversing the array in the memory block to produce the expected array. (does it traverse the elements in different axes in reverse order?)
[[[ 0 1 2 3]
[ 4 5 6 7]]
[[ 8 9 10 11]
[12 13 14 15]]]
I tried going through the official numpy code in C to understand, but I was not able to understand the same.
It would be great if somebody could just provide the explanation in a simpler way.