statistics.NormalDist.zscore

Full name
statistics.NormalDist.zscore
Library
statistics
Syntax

statistics.NormalDist.zscore(x)

Description

The zscore method of an object of type statistics.NormalDist returns the z-score of a value (its deviation from the mean of the distribution measured in standard deviations).

Parameters
  • x: Value for which you want to obtain the z-score.
Result

The statistics.NormalDist.zscore 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 z-score of the value x = 8 with the following code:

dist.zscore(8)
1.5
Submitted by admin on Sat, 04/24/2021 - 10:46