Counts the number of non-zero values in the array a.
a : array_like
The array for which to count non-zeros.
count : int
Number of non-zero values in the array.
See also
Examples
>>> np.count_nonzero(np.eye(4)) 4
>>> np.count_nonzero([[0,1,7,0,0],[3,0,0,2,19]]) 5
numpy.extract
Logic functions
Enter search terms or a module, class or function name.