sort array, apply rearrangement to second

Robert Kern robert.kern at
Wed Mar 31 21:13:52 CEST 2010

On 2010-03-31 13:58 PM, Victor Eijkhout wrote:
> Robert Kern<robert.kern at>  wrote:
>> second[first.argsort()]
> Really cool. Thanks.
>> Ask numpy questions on the numpy mailing list.
> I will. I thought that this question would have an answer in a generic
> python idiom.

When dealing with numpy arrays, the generic Python idiom is often much slower.

Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco

More information about the Python-list mailing list