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

Function argmin

numpy/array_api/_searching_functions.py:22–30  ·  view source on GitHub ↗

Array API compatible wrapper for :py:func:`np.argmin `. See its docstring for more information.

(x: Array, /, *, axis: Optional[int] = None, keepdims: bool = False)

Source from the content-addressed store, hash-verified

20
21
22def argmin(x: Array, /, *, axis: Optional[int] = None, keepdims: bool = False) -> Array:
23 """
24 Array API compatible wrapper for :py:func:`np.argmin <numpy.argmin>`.
25
26 See its docstring for more information.
27 """
28 if x.dtype not in _real_numeric_dtypes:
29 raise TypeError("Only real numeric dtypes are allowed in argmin")
30 return Array._new(np.asarray(np.argmin(x._array, axis=axis, keepdims=keepdims)))
31
32
33def nonzero(x: Array, /) -> Tuple[Array, ...]:

Callers

nothing calls this directly

Calls 2

_newMethod · 0.80
argminMethod · 0.45

Tested by

no test coverage detected