scipy.sparse.dok_matrix.getnnz

dok_matrix.getnnz()

This Page