def ztost(x1, low, upp, x2=None, usevar='pooled', ddof=1.0):
 tt1 = ztest(x1, x2, alternative='larger', usevar=usevar, value=low, ddof=ddof)
 tt2 = ztest(x1, x2, alternative='smaller', usevar=usevar, value=upp, ddof=ddof)
 return (np.maximum(tt1[1], tt2[1]), tt1, tt2)

def ztost ( x1 , low , upp , x2 = None , usevar = 'pooled' , ddof = 1.0 ) : tt1 = ztest ( x1 , x2 , alternative = 'larger' , usevar = usevar , value = low , ddof = ddof ) tt2 = ztest ( x1 , x2 , alternative = 'smaller' , usevar = usevar , value = upp , ddof = ddof ) return ( np . maximum ( tt1 [ 1 ] , tt2 [ 1 ] ) , tt1 , tt2 )
equivalence test based on normal distribution parameters x1 : array_like one sample or first sample for 2 independent samples low .