statistics.NormalDist.cdf

Full name
statistics.NormalDist.cdf
Library
statistics
Syntax

statistics.NormalDist.cdf(x)

Description

The cdf ("Cumulative Distribution Function") method of an object of type statistics.NormalDist returns the probability that the random variable being considered takes a value less than or equal to the value x passed as an argument. Mathematically it is written with the expression P(X ≤ x).

Parameters
  • x: Value with respect to which you want to calculate the probability.
Result

The statistics.NormalDist.cdf method returns a value of type float.

Examples

If we start from the following normal distribution:

dist = statistics.NormalDist(mu = 5, sigma = 2)

...we can obtain the probability that the variable takes a value equal to or less than 8 with the following code:

dist.cdf(x = 8)
0.9331927987311419
Submitted by admin on Mon, 04/19/2021 - 19:32