numpy.ndarray.nonzero — NumPy v2.6.dev0 Manual

method

ndarray.nonzero()

#

Return the indices of the elements that are non-zero.

Refer to

numpy.nonzero

for full documentation.