Numpy's function count_nonzero() returns the count of non-zero elements in the input array. You can use it for the sparse matrix too.
確定! 回上一頁