'ttest of Null hypothesis that mean is equal to value.
The alternative hypothesis H1 is defined by the following
\'two-sided\': H1: mean not equal to value
\'larger\' :   H1: mean larger than value
\'smaller\' :  H1: mean smaller than value
Parameters
value : float or array
the hypothesized value for the mean
alternative : string
The alternative hypothesis, H1, has to be one of the following
\'two-sided\': H1: mean not equal to value (default)
\'larger\' :   H1: mean larger than value
\'smaller\' :  H1: mean smaller than value
Returns
tstat : float
test statisic
pvalue : float
pvalue of the t-test
df : int or float'

def ttest_mean(self, value=0, alternative='two-sided'):

    tstat = ((self.mean - value) / self.std_mean)
    dof = (self.sum_weights - 1)
    if (alternative == 'two-sided'):
        pvalue = (stats.t.sf(np.abs(tstat), dof) * 2)
    elif (alternative == 'larger'):
        pvalue = stats.t.sf(tstat, dof)
    elif (alternative == 'smaller'):
        pvalue = stats.t.cdf(tstat, dof)
    return (tstat, pvalue, dof)
