[Numpy-discussion] A question about argmax and argsort
pgmdevlist at gmail.com
Wed Dec 20 17:17:54 CST 2006
On Wednesday 20 December 2006 18:02, Tom Denniston wrote:
> If you want the n largest item i would recommend quicksort
> I don't know of a way to do this in numpy. I think it would require
> adding a cfunction to numpy. Perhaps an "argnth" function?
> Does anyone else know of an existing mechanism?
Is it really needed when you have argsort ?
array([0, 3, 1, 4, 2])
>>> x[ax], x[ax[-1]], x[ax-3]]
1, 5, 3
Or am I once again missing the point entirely ?
More information about the Numpy-discussion