>
> I may miss something obvious, but why are you using lexsort at all ? At
> leat, the first example is easily achieved with sort(x, axis=0) - but
> maybe you have more complicated examples in mind where you need actual
> lexical sort:
>
> David

>From the examples that I tried out np.sort, sorts each column
separately (with axis = 0). If the elements of a row is supposed to
stay together, then np.sort doesn't work

>>> arr
array([[ 1, 14],
       [ 4, 12],
       [ 3, 11],
       [ 2, 14]])

>>> np.sort(arr,axis=0)
array([[ 1, 11],
       [ 2, 12],
       [ 3, 14],
       [ 4, 14]])

Josef
_______________________________________________
Numpy-discussion mailing list
[email protected]
http://projects.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to