Use scipy.stats.norm.interval(confidence, loc=mean, scale=sigma) , where trust is a value from 0 to 1, in your case it will be .95. the average value will be the average value of your data, and the sigma will be your typical standard deviation. The result of this will be a tuple, where the first value is the lower bound, and the second value is the upper bound of the interval. Hope this helps.
Sergey Victorovich Fogelson
source share