def lttest_1samp(a,popmean,printit=0,name='Sample',writemode='a'):
    x = mean(a)
    v = var(a)
    n = len(a)
    df = n-1
    svar = ((n-1)*v)/float(df)
    t = (x-popmean)/math.sqrt(svar*(1.0/n))
    prob = betai(0.5*df,0.5,float(df)/(df+t*t))

    if printit <> 0:
        statname = 'Single-sample T-test.'
        outputpairedstats(printit,writemode,
                          'Population','--',popmean,0,0,0,
                          name,n,x,v,min(a),max(a),
                          statname,t,prob)
    return t,prob
Calculates the t-obtained for the independent samples T-test on ONE group
dataset/ETHPy150Open radlab/sparrow/src/main/python/third_party/stats.py/lttest_1samp