Python Programming - Arrays - Discussion

Discussion Forum : Arrays - General Questions (Q.No. 43)
43.
How can you find the indices of non-zero elements in a NumPy array arr?
np.where(arr != 0)
np.nonzero(arr)
np.find_nonzero(arr)
arr.index_nonzero()
Answer: Option
Explanation:
The np.nonzero() function returns the indices of non-zero elements in the array.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.