[Numpy-discussion] sort bug

Anne Archibald peridot.faceted at gmail.com
Thu Apr 26 15:05:47 EDT 2007


On 26/04/07, Anton Sherwood <anton.sherwood at gmail.com> wrote:

> All I really need is the four highest eigenvalues and their vectors.

It's not really very efficient, but sorting time is going to be tiny
compared to however you get your eigenvalues, so you could argsort the
eigenvalue array and use the result to sort the eigenvector array.

You can also accelerate the process by quickly checking whether the
eigenvalue array is already sorted - usually it is.

Anne



More information about the NumPy-Discussion mailing list