import numpy as np  
from statsmodels.stats.proportion import proportion_confint  
  

def conf(successes, trials):
    confidence_level = 0.95  
      
    # Normal Approximation (Wald Method)  
    # Standard Error  
    se = np.sqrt((successes / trials) * (1 - (successes / trials)) / trials)  
    # Z-value for 95% confidence  
    z = 1.96  
    lower_wald = (successes / trials) - z * se  
    upper_wald = (successes / trials) + z * se  
    return (successes / trials, z * se)
