[issue40855] statistics.stdev ignore xbar argument

2020-06-17 Thread Matti
Matti added the comment: I meant to write "pre-calculate". -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue40855] statistics.stdev ignore xbar argument

2020-06-17 Thread Matti
Matti added the comment: >I see what you're trying to do but think that interpretation is surprising >and is at odds with the existing and intended uses of the *xbar* argument. > >The goals were to allow the mean to be precomputed (common case) or to be >recentered (uncommon). Neither case

[issue40855] statistics.stdev ignore xbar argument

2020-06-13 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thanks for the bug report  -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue40855] statistics.stdev ignore xbar argument

2020-06-13 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset 811e040b6e0241339545c2f055db8259b408802f by Miss Islington (bot) in branch '3.8': bpo-40855: Fix ignored mu and xbar parameters (GH-20835) (GH-20863) https://github.com/python/cpython/commit/811e040b6e0241339545c2f055db8259b408802f

[issue40855] statistics.stdev ignore xbar argument

2020-06-13 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset 55c1d21761e2e5feda5665065ea9e2280fa76113 by Miss Islington (bot) in branch '3.9': bpo-40855: Fix ignored mu and xbar parameters (GH-20835) (#GH-20862) https://github.com/python/cpython/commit/55c1d21761e2e5feda5665065ea9e2280fa76113

[issue40855] statistics.stdev ignore xbar argument

2020-06-13 Thread miss-islington
Change by miss-islington : -- pull_requests: +20054 pull_request: https://github.com/python/cpython/pull/20863 ___ Python tracker ___

[issue40855] statistics.stdev ignore xbar argument

2020-06-13 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +20053 pull_request: https://github.com/python/cpython/pull/20862 ___ Python tracker

[issue40855] statistics.stdev ignore xbar argument

2020-06-13 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset d71ab4f73887a6e2b380ddbbfe35b600d236fd4a by Raymond Hettinger in branch 'master': bpo-40855: Fix ignored mu and xbar parameters (GH-20835) https://github.com/python/cpython/commit/d71ab4f73887a6e2b380ddbbfe35b600d236fd4a --

[issue40855] statistics.stdev ignore xbar argument

2020-06-12 Thread Raymond Hettinger
Change by Raymond Hettinger : -- keywords: +patch pull_requests: +20029 stage: -> patch review pull_request: https://github.com/python/cpython/pull/20835 ___ Python tracker

[issue40855] statistics.stdev ignore xbar argument

2020-06-11 Thread Raymond Hettinger
Raymond Hettinger added the comment: > do you have any comment on my previous answer? I see what you're trying to do but think that interpretation is surprising and is at odds with the existing and intended uses of the *xbar* argument. The goals were to allow the mean to be precomputed

[issue40855] statistics.stdev ignore xbar argument

2020-06-11 Thread Matti
Matti added the comment: Hi Raymond and Steven! I'm happy that you are solving this issue but do you have any comment on my previous answer? -- ___ Python tracker ___

[issue40855] statistics.stdev ignore xbar argument

2020-06-04 Thread Matti
Matti added the comment: If we estimate the mean using a sample we loose one degree of freedom so it will be divided by N-1, while if we have the mean independent of the sample it should be divided by N to be unbiased. i.e. example 1 sqrt(((1-1.5)²+(2-1.5)²)/(2-1)) = 0.7... example 3

[issue40855] statistics.stdev ignore xbar argument

2020-06-03 Thread Steven D'Aprano
Steven D'Aprano added the comment: Thanks Raymond, that is the intended effect, and your analysis seems plausible. -- ___ Python tracker ___

[issue40855] statistics.stdev ignore xbar argument

2020-06-03 Thread Raymond Hettinger
Raymond Hettinger added the comment: Perhaps this would work: diff --git a/Lib/statistics.py b/Lib/statistics.py index c76a6ca519..93a4633464 100644 --- a/Lib/statistics.py +++ b/Lib/statistics.py @@ -682,8 +682,10 @@ def _ss(data, c=None): calculated from ``c`` as given. Use the second

[issue40855] statistics.stdev ignore xbar argument

2020-06-03 Thread Raymond Hettinger
Raymond Hettinger added the comment: The relevant code is in the _ss() helper function: # The following sum should mathematically equal zero, but due to rounding # error may not. U, total2, count2 = _sum((x-c) for x in data) assert T == U and count == count2 total -=

[issue40855] statistics.stdev ignore xbar argument

2020-06-03 Thread Raymond Hettinger
Change by Raymond Hettinger : -- nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40855] statistics.stdev ignore xbar argument

2020-06-03 Thread Matti
New submission from Matti : statistics.variance also has the same problem. >>> import statistics >>> statistics.stdev([1,2]) 0.7071067811865476 >>> statistics.stdev([1,2], 3) 0.7071067811865476 >>> statistics.stdev([1,2], 1.5) 0.7071067811865476 should be 0.7071067811865476 2.23606797749979