[SciPy-dev] max and argmax

dmitrey openopt at ukr.net
Fri Aug 3 10:58:34 EDT 2007


hi all,
in MATLAB
[val ind] = max(arr)
returns both max and index of the max element.

In Python I use
ind = argmax(arr)
val = arr(ind)
is it possible to avoid 2 lines, i.e. somehow to replace by single one?

D.



More information about the SciPy-Dev mailing list