SciPy

scipy.sparse.csc_matrix.getnnz

csc_matrix.getnnz(self, axis=None)[source]

Number of stored values, including explicit zeros.

Parameters
axisNone, 0, or 1

Select between the number of values across the whole matrix, in each column, or in each row.

See also

count_nonzero

Number of non-zero entries

Previous topic

scipy.sparse.csc_matrix.getmaxprint

Next topic

scipy.sparse.csc_matrix.getrow