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

Method argmin

numpy/matrixlib/defmatrix.py:721–758  ·  view source on GitHub ↗

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

(self, axis=None, out=None)

Source from the content-addressed store, hash-verified

719 return N.ndarray.min(self, axis, out, keepdims=True)._collapse(axis)
720
721 def argmin(self, axis=None, out=None):
722 """
723 Indexes of the minimum values along an axis.
724
725 Return the indexes of the first occurrences of the minimum values
726 along the specified axis. If axis is None, the index is for the
727 flattened matrix.
728
729 Parameters
730 ----------
731 See `numpy.argmin` for complete descriptions.
732
733 See Also
734 --------
735 numpy.argmin
736
737 Notes
738 -----
739 This is the same as `ndarray.argmin`, but returns a `matrix` object
740 where `ndarray.argmin` would return an `ndarray`.
741
742 Examples
743 --------
744 >>> x = -np.matrix(np.arange(12).reshape((3,4))); x
745 matrix([[ 0, -1, -2, -3],
746 [ -4, -5, -6, -7],
747 [ -8, -9, -10, -11]])
748 >>> x.argmin()
749 11
750 >>> x.argmin(0)
751 matrix([[2, 2, 2, 2]])
752 >>> x.argmin(1)
753 matrix([[3],
754 [3],
755 [3]])
756
757 """
758 return N.ndarray.argmin(self, axis, out)._align(axis)
759
760 def ptp(self, axis=None, out=None):
761 """

Callers

nothing calls this directly

Calls 1

_alignMethod · 0.80

Tested by

no test coverage detected