Consider a hyperrectangle or matrix of dimensions (a,b,c,d,e...). I was wondering if it was possible to "rotate" the rectangle such that the new matrix has dimensions of some random permutation (d,c,b,a,...) etc. For example, a cube is dimensions (x,y,z). I can rotate it in 3d space such that the cube has dimensions (y,z,x) or any permutation of the axis.
Is it always possible to change the axis of a matrix without reshuffling the contents of a matrix (aka preserving the hypercube content structure where if an element is neighboring n elements, it still neighbors them after the transformation)?
I am wondering because I don't understand how NumPy's transpose function can do this without changing the layout of a matrix.