"David Isaac" <[EMAIL PROTECTED]> 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:

len(iterable)-1


max


-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to