count_nonzero

astropy.utils.masked.function_helpers.count_nonzero(a, axis=None, *, keepdims=False)[source]

Counts the number of non-zero values in the array a.

Like numpy.count_nonzero, with masked values counted as 0 or False.