Loading…
DS · Statistics · Program 07 · In the record
Confidence intervals for population parameters.
1import numpy as np2from scipy import stats3 4data = [48, 52, 51, 49, 50, 53, 47, 52, 51, 50]5mean = np.mean(data)6print("Mean:", mean)7print("95% Confidence Interval:", stats.t.interval(0.95, len(data) - 1, loc=mean, scale=stats.sem(data)))Mean: 50.3 95% Confidence Interval: (np.float64(48.94900408571514), np.float64(51.650995914284856))
Run program 07 in your browser
Python 3.14 · Pyodide. Change the code or the input, run it, break it, and see what happens.