Loading…
DS · Statistics · Program 06 · In the record
Hypothesis testing using SciPy.
1from scipy import stats2 3t, p = stats.ttest_1samp([48, 52, 51, 49, 50, 53, 47, 52, 51, 50], 50)4print("T-statistic:", t)5print("P-value:", p)6print("Reject the null hypothesis" if p < 0.05 else "Fail to reject the null hypothesis")T-statistic: 0.5023310149673481 P-value: 0.6274948659508928 Fail to reject the null hypothesis
Run program 06 in your browser
Python 3.14 · Pyodide. Change the code or the input, run it, break it, and see what happens.