From the answer to this question, I learned how to sort the entries of one numpy array a by the values of another numpy array b, along a particular axis.
However, this method requires the creation of several intermediate arrays that are the same size as a, one for each dimension of a. Some of my arrays are quite large, and this becomes inconvenient. Is there a way to accomplish the same goal that uses less memory?
ain the linked question always consist of blocks of equal numbers? In this case, it would be rather easy to give a better solution.