def binom_tost(count, nobs, low, upp):
 tt1 = binom_test(count, nobs, alternative='larger', prop=low)
 tt2 = binom_test(count, nobs, alternative='smaller', prop=upp)
 return (np.maximum(tt1, tt2), tt1, tt2)

def binom_tost ( count , nobs , low , upp ) : tt1 = binom_test ( count , nobs , alternative = 'larger' , prop = low ) tt2 = binom_test ( count , nobs , alternative = 'smaller' , prop = upp ) return ( np . maximum ( tt1 , tt2 ) , tt1 , tt2 )
exact tost test for one proportion using binomial distribution parameters count : integer or array_like the number of successes in nobs trials .