def ttest_1samp_no_p(X, sigma=0, method='relative'):
 if (method not in ['absolute', 'relative']):
  raise ValueError(('method must be "absolute" or "relative", not %s' % method))
 var = np.var(X, axis=0, ddof=1)
 if (sigma > 0):
  limit = ((sigma * np.max(var)) if (method == 'relative') else sigma)
  var += limit
 return (np.mean(X, axis=0) / np.sqrt((var / X.shape[0])))

def ttest_1samp_no_p ( X , sigma = 0 , method = 'relative' ) : if ( method not in [ 'absolute' , 'relative' ] ) : raise ValueError ( ( 'method must be "absolute" or "relative", not %s' % method ) ) var = np . var ( X , axis = 0 , ddof = 1 ) if ( sigma > 0 ) : limit = ( ( sigma * np . max ( var ) ) if ( method == 'relative' ) else sigma ) var += limit return ( np . mean ( X , axis = 0 ) / np . sqrt ( ( var / X . shape [ 0 ] ) ) )
perform t-test with variance adjustment and no p-value calculation .