MCPcopy Index your code
hub / github.com/python/cpython / zscore

Method zscore

Lib/statistics.py:1331–1340  ·  view source on GitHub ↗

Compute the Standard Score. (x - mean) / stdev Describes *x* in terms of the number of standard deviations above or below the mean of the normal distribution.

(self, x)

Source from the content-addressed store, hash-verified

1329 return 1.0 - (fabs(Y.cdf(x1) - X.cdf(x1)) + fabs(Y.cdf(x2) - X.cdf(x2)))
1330
1331 def zscore(self, x):
1332 """Compute the Standard Score. (x - mean) / stdev
1333
1334 Describes *x* in terms of the number of standard deviations
1335 above or below the mean of the normal distribution.
1336 """
1337 # https://www.statisticshowto.com/probability-and-statistics/z-score/
1338 if not self._sigma:
1339 raise StatisticsError('zscore() not defined when sigma is zero')
1340 return (x - self._mu) / self._sigma
1341
1342 @property
1343 def mean(self):

Callers 1

test_zscoreMethod · 0.95

Calls 1

StatisticsErrorClass · 0.85

Tested by 1

test_zscoreMethod · 0.76