[Numpy-discussion] Indices of min/max element of an array?

Christos Siopis christos.siopis at ulb.ac.be
Tue Dec 6 09:06:24 CST 2005


Hi all,

I was wondering if i'm missing a numpy/numarray function that would return the 
indices of the minimum/maximum element of an array. Argmin/max can only do this 
one axis at a time. Alternatively, one can find the index for the flattened array 
and then play with modulo arithmetic, which gets quickly annoying for > 2 
dimensions. Since this is a rather frequent operation, i would think there's 
already a function for it?...

Thanks,
Christos




More information about the Numpy-discussion mailing list