[SciPy-user] one-liner to retrieve indices of n smallest values from an array?
ahoover at eecs.berkeley.edu
Tue Oct 17 23:09:14 CDT 2006
Thanks, is there a simple way to extend this to 2D arrays, or does
that require the use of ravel()?
On Oct 17, 2006, at 8:52 PM, Robert Kern wrote:
> Aaron Hoover wrote:
>> Hi all,
>> Perhaps this is better suited for the NumPy list, but is there a
>> simple (one line, perhaps) way to get the indices of the n smallest
>> elements of an array? Something along the lines of argmin() that
>> could take a parameter indicating
>> how many minimal values to return?
> 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
> SciPy-user mailing list
> SciPy-user at scipy.org
More information about the SciPy-user