On Wed, 18 Oct 2006, Holden Chase apparently wrote:
> I would like to get the array indices of the max value in an array. Is
> there a more elegant way than what I have implemented below using
> argmax()? This routine returns the indices and the max value.
Untested:
def arrayMaxInd(data):
a = asarray(data)
argmax1d = a.argmax()
rs,cs = a.shape
r,c = argmax1d//cs, argmax1d%cs
return (r,c,argmax1d)
hth,
Alan Isaac