[Numpy-discussion] why sort does not accept a key?

Alan G Isaac alan.isaac at gmail.com
Mon Mar 24 13:05:21 EDT 2014


> On Mon, Mar 24, 2014 at 12:08 PM, Alan G Isaac
>> what is the preferred idiom for a descending sort?


On 3/24/2014 12:13 PM, josef.pktd at gmail.com wrote:
> adding [::-1] just creates a new view, pretty low cost.


I meant when you need to sort on a key (another vector).

Currently I'm just reversing the result of argsort with [::-1]
but this changes the sort order (relative to a stable descending sort).

Alan Isaac




More information about the NumPy-Discussion mailing list