(x)
return np.prod(x.shape) != x.nnz
Check if sparse matrix contains any implicit zeros.
Check if sparse matrix contains any implicit zeros.
Check if sparse matrix contains any implicit zeros .
def sparse_has_implicit_zeros(x):
    """ Check if sparse matrix contains any implicit zeros. """
    if not sp.issparse(x):
        raise TypeError('The matrix provided was not sparse.')
    return np.prod(x.shape) != x.nnz
def sparse_has_implicit_zeros ( x ) : if not sp . issparse ( x ) : raise TypeError ( 'The matrix provided was not sparse.' ) return np . prod ( x . shape ) != x . nnz