def mean_variance_axis(X, axis):
 _raise_error_wrong_axis(axis)
 if isinstance(X, sp.csr_matrix):
  if (axis == 0):
   return _csr_mean_var_axis0(X)
  else:
   return _csc_mean_var_axis0(X.T)
 elif isinstance(X, sp.csc_matrix):
  if (axis == 0):
   return _csc_mean_var_axis0(X)
  else:
   return _csr_mean_var_axis0(X.T)
 else:
  _raise_typeerror(X)

def mean_variance_axis ( X , axis ) : _raise_error_wrong_axis ( axis ) if isinstance ( X , sp . csr_matrix ) : if ( axis == 0 ) : return _csr_mean_var_axis0 ( X ) else : return _csc_mean_var_axis0 ( X . T ) elif isinstance ( X , sp . csc_matrix ) : if ( axis == 0 ) : return _csc_mean_var_axis0 ( X ) else : return _csr_mean_var_axis0 ( X . T ) else : _raise_typeerror ( X )
compute mean and variance along an axix on a csr or csc matrix parameters x : csr or csc sparse matrix .