Python for Introductory Statistics: Lab WorkbookXYZ Homework Edition

⇩ Download ▾

Probability Distributions

from scipy import stats
procedurescipy.stats
Binomial pdf P(X=x)P(X=x) stats.binom.pmf(x,n,p)
Binomial cdf P(X≤x)P(X\le x) stats.binom.cdf(x,n,p)
Normal cdf P(X≤x)P(X\le x) stats.norm.cdf(x,mean,std)
Inverse Normal or p-th Percentile stats.norm.ppf(p,mean,std)
t distribution cdf P(X≤x)P(X\le x) stats.t.cdf(t,df,0,1)
Inverse t or p-th Percentile stats.t.ppf(p,df,0,1)
chi-square cdf P(χ2≤ch2)P(\chi^2 \le ch2) stats.chi2.cdf(ch2,k-1)
Inverse chi-square or p-th Percentile stats.chi2.ppf(p,k-1)

Adapted from Python for Introductory Statistics: Student's Lab Workbook, by Simon Aman (Truman College, City Colleges of Chicago), licensed under CC BY 4.0. Changes were made: reformatted as an accessible XYZ web edition with live in-browser code cells. License: CC-BY-4.0.

These eBooks are a prerelease and are not yet certified conformant with WCAG 2.1 AA or any other accessibility standard. Every page is built against an automated accessibility gate, and our target for the published editions is WCAG 2.2 Level AA. If something is unusable, please tell us.