[Numpy-discussion] Sorting of an array row-by-row?

Charles R Harris charlesr.harris at gmail.com
Fri Oct 20 21:02:18 EDT 2017

On Fri, Oct 20, 2017 at 1:40 PM, Joseph Fox-Rabinovitz <
jfoxrabinovitz at gmail.com> wrote:

> I do not think that there is any particular relationship between the
> order of the keys and lexicographic order. The key order is just a
> convention, which is clearly documented. I agree that it is a bit
> counter-intuitive for anyone that has used excel or MATLAB, but it is
> ingrained in the API at this point.

When I wrote lexsort for numarray, together with the typed sorting
routines, I went back and forth on the key order, but finally decided that
the simplest thing would be to leave them in the same order as the sorts.
That requires a bit of knowledge as to what the effect of that is, but if
one remembers that the last sort dominates it isn't to bad.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20171020/177810e3/attachment-0001.html>

More information about the NumPy-Discussion mailing list