The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →scipy.stats.norm provides methods to evaluate normal-distribution density, calculate cumulative probabilities, find quantiles, generate random values, and return central intervals. By default it represents the standard normal distribution; set loc to the mean and scale to the standard deviation for another normal distribution.
Set up the normal distribution
Import norm from scipy.stats. Its default parameters are loc=0 and scale=1, the standard normal distribution. In this API, loc is the mean, and scale is the standard deviation.
As an Amazon Associate I earn from qualifying purchases.
from scipy.stats import norm
mu = 5
sigma = 2
rv = norm(loc=mu, scale=sigma)
Use the resulting frozen distribution, rv, when you want multiple calculations to share the same parameters. For example, rv.cdf(x) and rv.ppf(q) make the selected mean and standard deviation explicit in the object setup. You can also pass loc and scale directly to individual norm methods. See the SciPy norm API reference; check the documentation for your installed SciPy release for version-specific details.
Recommended Free Tools
Choose the method for the quantity you have
| What you have | What you want | Method |
|---|---|---|
A value, such as x |
Density at that value | pdf(x) |
A value, such as x |
Probability of a draw being at or below it | cdf(x) |
A cumulative probability, such as q |
The value at that quantile | ppf(q) |
| A distribution and requested draw count | Simulated values | rvs(size=n) |
| A requested central coverage probability | The interval endpoints | interval(confidence) |
These methods accept array-like inputs for vectorized calculations. SciPy’s probability distributions tutorial demonstrates passing both a list and a NumPy array to cdf.
#1 Best Overall
Evaluate density with pdf
pdf(x, loc=mu, scale=sigma) evaluates the probability density at x. For a standard normal input z, the density is exp(-z**2 / 2) / sqrt(2*pi). For a normal distribution with mean mu and standard deviation sigma, standardize the input as z = (x - mu) / sigma; the density is the standard-normal density at z, divided by sigma.
A PDF value is a density, not the probability of observing exactly that value. For a continuous distribution, use cdf or a difference between CDF values to calculate probability over a range.
Rank #2
- This guide is a perfect overview for the topics covered in introductory statistics courses.
Calculate cumulative probability with cdf
cdf(x, loc=mu, scale=sigma) returns the probability that a draw is at or below x. To calculate the probability of a draw falling between a and b, subtract the lower cumulative probability from the upper one:
probability_between = norm.cdf(b, loc=mu, scale=sigma) - norm.cdf(a, loc=mu, scale=sigma)
For the standard normal, norm.cdf(0) is 0.5. The same method works with arrays, so you can calculate cumulative probabilities for several values in one call.
Rank #3
Find a quantile with ppf
ppf(q, loc=mu, scale=sigma) is the inverse of the CDF: it returns the value whose cumulative probability is q. Use it when you know a probability and need the corresponding cutoff. For example, norm.ppf(0.5) returns 0.0 for the standard normal median. Supply the same loc and scale as the distribution of interest when finding a quantile for a nonstandard normal distribution.
Generate simulated values with rvs
Use rvs to draw random variates. Set size to the number of values you want; pass loc and scale by keyword to make the distribution parameters clear.
Rank #4
draws = norm.rvs(loc=5, scale=2, size=100)
For reproducible results, pass a fixed random-state value or generator using random_state, in accordance with the API for your SciPy version. A common trap is writing norm.rvs(5) to request five draws: the positional argument is interpreted as loc, not size, so the default sample count remains one. The SciPy tutorial specifically cautions against this positional-argument mistake.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Get a central interval with interval
interval(confidence, loc=mu, scale=sigma) returns the endpoints of an equal-tailed interval containing the requested probability of the distribution. Because the normal distribution is symmetric, this central interval is centered on its mean. For example, use norm.interval(0.95, loc=mu, scale=sigma) to request endpoints for an interval containing 95% of that normal distribution.
Best Value
This is a distribution interval, not automatically a confidence interval for an unknown parameter estimated from data. A statistical confidence interval for a parameter requires an inferential model and an uncertainty calculation suited to the estimator; the norm.interval call alone does not provide that analysis. SciPy’s reference guide for the interval method describes endpoints containing a requested proportion of the distribution.
Check your SciPy version
The cited API reference is for SciPy 1.16.2, while the tutorial is for SciPy 1.18.0 and the interval reference is from SciPy 0.13.0. Consult the documentation matching your installed release before relying on release-specific signatures or behavior. The meanings of density, cumulative probability, quantile, random variates, and a central distribution interval are the key distinctions when choosing among these methods.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
Free tools Windows power users keep installed
One-click scans. No signup required.




