[issue40290] Add z_score to statistics.NormalDist
Raymond Hettinger
report at bugs.python.org
Tue Apr 14 23:14:09 EDT 2020
New submission from Raymond Hettinger <raymond.hettinger at gmail.com>:
I've had a couple of requests for a z-score method, once to produce an actual z-score for output and another as a way of normalizing gaussian inputs for machine learning.
Proposed:
>>> iq = NormalDist(100, 15)
>>> iq.zscore(142)
2.8
Same result as:
>>> (142 - iq.mean) / iq.stdev
2.8
There is some question about whether to name it zscore or z_score. Numpy uses zscore but numpy tends to scrunch names where we would tend to spell them out or use an underscore for readability.
See: https://en.wikipedia.org/wiki/Standard_score
----------
assignee: rhettinger
components: Library (Lib)
messages: 366484
nosy: rhettinger, steven.daprano
priority: normal
severity: normal
status: open
title: Add z_score to statistics.NormalDist
type: enhancement
versions: Python 3.9
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40290>
_______________________________________
More information about the Python-bugs-list
mailing list