[Numpy-discussion] is there a way to get Nd indices of max of Nd array

Chris Colbert sccolbert at gmail.com
Sun May 3 15:30:28 EDT 2009


my case is only for 2d, but should apply to Nd as well.

It would be convienent if np.max would return a tuple of the max value and
its Nd location indices.

Is there an easier way than just using the 1d flattened array max index
(np.argmax) and calculating its corresponding Nd location?

Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20090503/8b279925/attachment.html>


More information about the NumPy-Discussion mailing list