[SciPy-user] How to use argmax ?

LB berthe.loic@gmail....
Tue Oct 23 01:27:21 CDT 2007


>>> a = array([[10, 20, 14], [60, 5, 7]])
>>> ind = a.argmax(axis=0)
>>> a[ind, xrange(a.shape[1])] == a.max(axis=0)
array([ True,  True,  True], dtype=bool)

That's what I was looking for
Thanks !

This was really not evident for me. If I find some time, I'll add this
to the argmax example.

--
LB



More information about the SciPy-user mailing list