[Numpy-discussion] 1D array sorting ascending and descending by fields

Patrick Redmond plredmond@gmail....
Mon Jun 4 12:31:45 CDT 2012


Hi!

I have a one-dimensional ndarray with two fields. I'd like to sort in
descending order by field 'a', breaking ties by sorting in ascending
order by field 'b'.

I've found combinations of sorting and reversing followed by stable
sorting that work, but there must be a straightforward way to do it.

Your help is appreciated!

Thank you,
Patrick


More information about the NumPy-Discussion mailing list