statistics.NormalDist.pdf(x)
The pdf ("Probability Density Function") method of an object of type statistics.NormalDist returns the relative probability that the random variable being considered takes a value close to the value x passed as an argument.
Mathematically, this probability is the limit of P(x ≤ X < x + dx) as dx approaches zero.
The returned result can be greater than 1 because the calculated probability is relative to other points in the distribution.
- x: Value with respect to which you want to calculate the relative probability.
The statistics.NormalDist.pdf method returns a value of type float.
If we start from the following normal distribution:
...we can obtain the relative probability that the variable takes the value 8 with the following code: