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

Method argmin

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

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

Callers

nothing calls this directly

Calls 1

_alignMethod · 0.80

Tested by

no test coverage detected