diff options
author | Raymond Hettinger <rhettinger@users.noreply.github.com> | 2022-05-03 03:41:46 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-03 03:41:46 -0500 |
commit | ec8d3adb99f1ad93786fed5c1def5119b6ec73c0 (patch) | |
tree | 8f7492d60020447ef5cad9f3be853ca9fc05321d /Lib | |
parent | 9b027d4cea57e98c76f5176cc3188dc81603356c (diff) | |
download | cpython-ec8d3adb99f1ad93786fed5c1def5119b6ec73c0.tar.gz cpython-ec8d3adb99f1ad93786fed5c1def5119b6ec73c0.zip |
The stdev calculation is more accurate computing its own mean (#92220)
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/statistics.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/statistics.py b/Lib/statistics.py index f3bc9a1f346..6e6d62c4a0e 100644 --- a/Lib/statistics.py +++ b/Lib/statistics.py @@ -1173,8 +1173,7 @@ class NormalDist: "Make a normal distribution instance from sample data." if not isinstance(data, (list, tuple)): data = list(data) - xbar = fmean(data) - return cls(xbar, stdev(data, xbar)) + return cls(mean(data), stdev(data)) def samples(self, n, *, seed=None): "Generate *n* samples for a given mean and standard deviation." |