You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/array_api_stubs/_draft/searching_functions.py
+9-5Lines changed: 9 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -151,17 +151,21 @@ def where(
151
151
Parameters
152
152
----------
153
153
condition: array
154
-
when ``True``, yield ``x1_i`` (scalar ``x1``); otherwise, yield ``x2_i`` (scalar ``x2``). Must be compatible with ``x1`` and ``x2`` (see :ref:`broadcasting`).
155
-
x1: Union[array, int, float, bool]
156
-
first input array or scalar. Must be compatible with ``condition`` and ``x2`` (see :ref:`broadcasting`).
157
-
x2: Union[array, int, float, bool]
158
-
second input array or scalar. Must be compatible with ``condition`` and ``x1`` (see :ref:`broadcasting`).
154
+
when ``True``, yield ``x1_i``; otherwise, yield ``x2_i``. Must be compatible with ``x1`` and ``x2`` (see :ref:`broadcasting`).
155
+
x1: Union[array, int, float, complex, bool]
156
+
first input array or scalar. Scalar values are treated like an array filled with this value. Must be compatible with ``condition`` and ``x2`` (see :ref:`broadcasting`).
157
+
x2: Union[array, int, float, complex, bool]
158
+
second input array or scalar. Scalar values are treated like an array filled with this value. Must be compatible with ``condition`` and ``x1`` (see :ref:`broadcasting`).
159
159
160
160
Returns
161
161
-------
162
162
out: array
163
163
an array with elements from ``x1`` where ``condition`` is ``True``, and elements from ``x2`` elsewhere. The returned array must have a data type determined by :ref:`type-promotion` rules with the arrays ``x1`` and ``x2``.
164
164
165
+
Notes
166
+
-----
167
+
See :ref:`mixing-scalars-and-arrays` on compatibility requirements and handling of scalar arguments for ``x1`` and ``x2``.
0 commit comments