[SciPy-user] How to use argmax ?

Daniel Lenski dlenski@gmail....
Mon Oct 22 14:08:16 CDT 2007


On Mon, 22 Oct 2007 19:04:54 +0000, Daniel Lenski wrote:

> Or maybe this is what you're looking for:
> 
>>>>> ind = a.argmax(axis=0)
>>>>> a[ ind, [0,1,2] ]
> array([60, 20, 14])
> 
> ... which basically returns a[ind[0],0], a[ind[1],1], and a[ind[2],2].
> 
> Dan

Yeah, there really must be a straightforward, easy way to do this without 
explicitly listing the indices.  Hmmm...



More information about the SciPy-user mailing list