larray-project / larray

N-dimensional labelled arrays in Python
https://larray.readthedocs.io/
GNU General Public License v3.0
8 stars 6 forks source link

Make Array.labelsofsorted, Array.indicesofsorted and Array.sort_values consistent #1038

Open gdementen opened 1 year ago

gdementen commented 1 year ago

When used on arrays with ndim >= 2, and without argument is given, Array.sort_values combines axes, while Array.labelsofsorted and Array.indicesofsorted both raise an Exception. FWIW, numpy uses the last axis (axis=1) in those cases.

We discussed this in #225 but never actually done anything about this AFAIK.

From the discussion in #225, I guess we should combine axes by default in labelsofsorted and indicesofsorted. The other option is to make all three methods use the last axis by default.