Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How does Numpy find an index that is not zero in an array

Shulou Source: shulou.com Published: 2022-06-01 07:53:18 10月03日 Update

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!

Tags: Array index learning content that is ideas situations articles more knowledge knowledge points articles results follow questions practice push research verification Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi NVidia Shulou Technology vpn MySQL