summaryrefslogtreecommitdiff
path: root/numpy/array_api/_searching_functions.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/array_api/_searching_functions.py')
-rw-r--r--numpy/array_api/_searching_functions.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/numpy/array_api/_searching_functions.py b/numpy/array_api/_searching_functions.py
index 9dcc76b2d..3dcef61c3 100644
--- a/numpy/array_api/_searching_functions.py
+++ b/numpy/array_api/_searching_functions.py
@@ -7,6 +7,7 @@ from typing import Optional, Tuple
import numpy as np
+
def argmax(x: Array, /, *, axis: Optional[int] = None, keepdims: bool = False) -> Array:
"""
Array API compatible wrapper for :py:func:`np.argmax <numpy.argmax>`.
@@ -15,6 +16,7 @@ def argmax(x: Array, /, *, axis: Optional[int] = None, keepdims: bool = False) -
"""
return Array._new(np.asarray(np.argmax(x._array, axis=axis, keepdims=keepdims)))
+
def argmin(x: Array, /, *, axis: Optional[int] = None, keepdims: bool = False) -> Array:
"""
Array API compatible wrapper for :py:func:`np.argmin <numpy.argmin>`.
@@ -23,6 +25,7 @@ def argmin(x: Array, /, *, axis: Optional[int] = None, keepdims: bool = False) -
"""
return Array._new(np.asarray(np.argmin(x._array, axis=axis, keepdims=keepdims)))
+
def nonzero(x: Array, /) -> Tuple[Array, ...]:
"""
Array API compatible wrapper for :py:func:`np.nonzero <numpy.nonzero>`.
@@ -31,6 +34,7 @@ def nonzero(x: Array, /) -> Tuple[Array, ...]:
"""
return tuple(Array._new(i) for i in np.nonzero(x._array))
+
def where(condition: Array, x1: Array, x2: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.where <numpy.where>`.