[Numpy-discussion] A question about argmax and argsort

asaf david asafdav2 at gmail.com
Tue Dec 12 08:06:53 CST 2006


Hello
Let's say i have an N sized array, and i want to get the positions of the K
largest items. for K = 1 this is simply argmax. is there any way to
generalize it for k !=1? currently I use argsort and take only K items from
it, but I'm paying an additional ~lg(N)...

Thanks in advance, asaf
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20061212/114c8d1e/attachment-0001.html 


More information about the Numpy-discussion mailing list