1import numpy as np
2import scipy.stats as st
3
4#define sample data
5data = [12, 12, 13, 13, 15, 16, 17, 22, 23, 25, 26, 27, 28, 28, 29]
6
7#create 95% confidence interval for population mean weight
8st.t.interval(alpha=0.95, df=len(data)-1, loc=np.mean(data), scale=st.sem(data))
9
10(16.758, 24.042)