Data Science, Product Analytics, Ab Testing, Simulation, Deep Dives.
real-life data is t-test distribution, which gives a broader confidence interval (since it assumes fatter tales than normal distribution). def get_ttest_confidence_interval(data, confidence=0.95): # Calculate sample mean and standard deviation sample_mean = np.mean(data) sample_std = np.std(data,