MCPcopy Create free account
hub / github.com/numpy/numpy / argmax

Method argmax

numpy/matrixlib/defmatrix.py:647–684  ·  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

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

Callers 1

Calls 1

_alignMethod · 0.80

Tested by 1