MCPcopy Index your code
hub / github.com/numpy/numpy / argmax

Method argmax

numpy/matrixlib/defmatrix.py:652–689  ·  view source on GitHub ↗

Indexes of the maximum values along an axis. Return the indexes of the first occurrences of the maximum values along the specified axis. If axis is None, the index is for the flattened matrix. Parameters ---------- See `numpy.argmax` for co

(self, axis=None, out=None)

Source from the content-addressed store, hash-verified

650 return N.ndarray.max(self, axis, out, keepdims=True)._collapse(axis)
651
652 def argmax(self, axis=None, out=None):
653 """
654 Indexes of the maximum values along an axis.
655
656 Return the indexes of the first occurrences of the maximum values
657 along the specified axis. If axis is None, the index is for the
658 flattened matrix.
659
660 Parameters
661 ----------
662 See `numpy.argmax` for complete descriptions
663
664 See Also
665 --------
666 numpy.argmax
667
668 Notes
669 -----
670 This is the same as `ndarray.argmax`, but returns a `matrix` object
671 where `ndarray.argmax` would return an `ndarray`.
672
673 Examples
674 --------
675 >>> x = np.matrix(np.arange(12).reshape((3,4))); x
676 matrix([[ 0, 1, 2, 3],
677 [ 4, 5, 6, 7],
678 [ 8, 9, 10, 11]])
679 >>> x.argmax()
680 11
681 >>> x.argmax(0)
682 matrix([[2, 2, 2, 2]])
683 >>> x.argmax(1)
684 matrix([[3],
685 [3],
686 [3]])
687
688 """
689 return N.ndarray.argmax(self, axis, out)._align(axis)
690
691 def min(self, axis=None, out=None):
692 """

Callers 1

Calls 1

_alignMethod · 0.80

Tested by 1