I have a 3 dimensional numpy array of dimensions 333*333*52
I have a 333 element lists of indices ranging from 0-332 eg [4 12 332 0 ...] that I wish to use to rearrange the first two dimensions of the 3d array
In matlab I would do:
rearranged_array = original_array(new_order, new_order, :)
But this approach does not work with numpy:
rearranged_array = original_array[new_order, new_order, :]
Produces a 333*52 array
While:
rearranged_array = original_array[new_order][new_order, :]
Does not get things in the right order
Edit:
This seems to work:
rearranged_array = original_array[new_order, :][:, new_order]
This seems a lot less intuitive to me than the matlab method - are there any better ways?