Max Erickson maxerickson at
Thu Jun 1 17:29:46 CEST 2006

"David Isaac" <aisaac0 at> wrote:

> 1. Why is there no argmax built-in?
> (This would return the index of the largest element in a
> sequence.) 
> 2. Is this a good argmax (as long as I know the iterable is
> finite)? def argmax(iterable): return max(izip( iterable, count()
> ))[1] 

use len:



More information about the Python-list mailing list