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

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
convert a scipy .