Skip to content

Commit 41b1b39

Browse files
authored
Clarify expected behavior when providing a complex number array to nonzero (#441)
1 parent b09cda6 commit 41b1b39

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

spec/API_specification/array_api/searching_functions.py

+6
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ def nonzero(x: array, /) -> Tuple[array, ...]:
4242
"""
4343
Returns the indices of the array elements which are non-zero.
4444
45+
.. note::
46+
If ``x`` has a complex floating-point data type, non-zero elements are those elements having at least one component (real or imaginary) which is non-zero.
47+
48+
.. note::
49+
If ``x`` has a boolean data type, non-zero elements are those elements which are equal to ``True``.
50+
4551
.. admonition:: Data-dependent output shape
4652
:class: admonition important
4753

0 commit comments

Comments
 (0)