All,

I am trying to get the maximum value in a 2-D array.  I can use max but it
returns the 1-D array that the max value is in and I then I need to do max
again on that array to get the single max value.

There has to be a more straightforward way...I have just not found it.

>>> b = array([[1,2],[3,4]])
>>> max(b)
array([3, 4])
>>> c = max(b)
>>> max(c)
4
>>>

I could also flatten the array to 1 D first then do max but the array I am
going to be working with is fairly large.

Thanks 
_______________________________________________
Tutor maillist  -  [EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to