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?