Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minutePC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Use scipy.stats.expon to calculate exponential probabilities, quantiles, or random waiting times. The key parameter detail is that SciPy takes scale, not a rate: for rate lambda, set scale=1/lambda. Its default model has loc=0 and scale=1.
Set the rate and scale correctly
SciPy describes scipy.stats.expon as “An exponential continuous random variable.” Its standard density is exp(-x) for x >= 0. SciPy expresses the general location-and-scale form by transforming a value as y = (x - loc) / scale; the density is the standardized density at y, divided by scale. The defaults are loc=0 and scale=1. See the SciPy 1.16.0 expon API reference.
As an Amazon Associate I earn from qualifying purchases.
For the zero-location exponential model, scale is the mean waiting time. If your model is given as a rate lambda per unit time, convert it using scale = 1/lambda. For example, a rate of 0.2 events per hour means a scale of 5 hours. Passing the rate itself as scale reverses the intended relationship and changes the distribution.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →from scipy.stats import expon
rate = 0.2 # events per hour
rv = expon(scale=1 / rate)
prob_within_5_hours = rv.cdf(5)
prob_after_5_hours = rv.sf(5)
samples = rv.rvs(size=1000, random_state=42)
Prefer keyword arguments for loc and scale, which makes their roles explicit. For example, expon(scale=3) represents a zero-origin exponential with mean 3 units. SciPy’s tutorial discusses supplying these parameters explicitly: SciPy statistics tutorial.
#1 Best Overall
Choose the method for the question
| Goal | Method | Example |
|---|---|---|
Probability a waiting time is at most t |
cdf(t) |
rv.cdf(5) |
Probability a waiting time exceeds t |
sf(t) |
rv.sf(5) |
| Generate random waiting times | rvs |
rv.rvs(size=1000, random_state=42) |
| Find a value at a given cumulative probability | ppf |
rv.ppf(0.95) |
| Find a value at a given upper-tail probability | isf |
rv.isf(0.05) |
| Get distribution moments | stats |
rv.stats() |
| Inspect support bounds | support |
rv.support() |
The table uses a frozen random variable, created by calling expon with its parameters. You can also call methods on the distribution with parameters supplied directly. The API includes pdf and logpdf for density calculations, and logcdf and logsf for logarithmic probabilities.
Calculate upper-tail probabilities with sf
For the probability that an event happens after time t, use the survival function: rv.sf(t). It represents the upper tail, equivalent to 1 - rv.cdf(t). SciPy notes that sf can be more accurate in some cases, so it is preferable to subtract the CDF when calculating a tail probability. The method and its numerical qualification are documented in the expon API reference.
Rank #2
- This guide is a perfect overview for the topics covered in introductory statistics courses.
Use loc only when the support should start later
The loc parameter shifts the distribution and its support origin; it does not make the exponential “noncentral.” With loc=0, the support begins at zero. A positive location shifts that starting point. Set loc only when that shift is part of the model, and keep it distinct from scale, which controls the spread and, for the zero-location model, the mean.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Distinguish expon from related distributions
SciPy’s exponential distribution is a special case of the gamma distribution with shape a=1. Do not confuse scipy.stats.expon with scipy.stats.exponnorm: the latter is the exponentially modified normal distribution, a different model. SciPy’s official generalized exponential distribution reference includes exponential-family background.
Rank #3
Check the installed SciPy version
The parameterization and API details here are documented in the SciPy 1.16.0 reference. If your code depends on a particular version, consult the matching documentation for that installed version rather than assuming every detail is unchanged.
Quick Recap
Best Value
Rank #4
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.




