(e)
Convert a scipy.sparse zero matrix to the zero scalar.
Convert a scipy.sparse zero matrix to the zero scalar.
Convert a scipy . sparse zero matrix to the zero scalar .
def _scipy_sparse_matrix_to_zero(e):
    """Convert a scipy.sparse zero matrix to the zero scalar."""
    if not np:
        raise ImportError
    edense = e.todense()
    test = np.zeros_like(edense)
    if np.allclose(edense, test):
        return 0.0
    else:
        return e
def _scipy_sparse_matrix_to_zero ( e ) : if not np : raise ImportError edense = e . todense ( ) test = np . zeros_like ( edense ) if np . allclose ( edense , test ) : return 0.0 else : return e