SciPy

scipy.sparse.csc_matrix.getnnz

csc_matrix.getnnz()[source]