How does Numpy find an index that is not zero in an array
This article mainly explains "Numpy how to find an index that is not zero in an array". The content of the explanation in the article is simple and clear, and it is easy to learn and understand. Please follow Xiaobian's train of thought to study and learn "Numpy how to find an index that is not zero in an array".
Find an index that is not zero in the array
Z = np.nonzero ([1, 2, 3, 4, 5, 0, 0, 0, 0, 0, 1234, 0, 0, 1]) print (z)
Print the results:
(array ([0, 1, 2, 3, 4, 8, 10]),) Thank you for reading, the above is the content of "how Numpy finds an index that is not zero in an array". After the study of this article, I believe you have a deeper understanding of how Numpy finds an index that is not zero in an array. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!