Login
📚 Python for Introductory Statistics
Chapters ▾

Probability Distributions

from scipy import stats
procedurescipy.stats
Binomial pdf P(X=x) stats.binom.pmf(x,n,p)
Binomial cdf P(Xx) stats.binom.cdf(x,n,p)
Normal cdf P(Xx) stats.norm.cdf(x,mean,std)
Inverse Normal or p-th Percentile stats.norm.ppf(p,mean,std)
t distribution cdf P(Xx) stats.t.cdf(t,df,0,1)
Inverse t or p-th Percentile stats.t.ppf(p,df,0,1)
chi-square cdf P(χ2ch2) 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, 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.