[issue21184] statistics.pvariance with known mean does not work as expected

2021-08-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: See commit d71ab4f73887a6e2b380ddbbfe35b600d236fd4a for bpo-40855. -- nosy: +rhettinger resolution: -> fixed stage: needs patch -> resolved status: open -> closed ___ Python tracker

[issue21184] statistics.pvariance with known mean does not work as expected

2021-08-20 Thread Irit Katriel
Irit Katriel added the comment: I can't reproduce this on 3.11, was it fixed? >>> import statistics >>> data = [1, 2, 2, 2, 3, 4] >>> statistics.pvariance(data) 0. >>> statistics.pvariance(data, 2.5) 0.9166 >>> -- nosy: +iritkatriel ___

[issue21184] statistics.pvariance with known mean does not work as expected

2014-04-09 Thread Wolfgang Maier
Wolfgang Maier added the comment: ok, there may be use cases for calculating a variance estimate in such situations, but IMHO what you are trying to do is to abuse a function which is not documented to be made for the purpose and then complain that it does not behave correctly. The *documente

[issue21184] statistics.pvariance with known mean does not work as expected

2014-04-09 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python

[issue21184] statistics.pvariance with known mean does not work as expected

2014-04-09 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Wed, Apr 09, 2014 at 08:20:42AM +, Wolfgang Maier wrote: > I do not think this is a bug in the module, but rather incorrect usage. [...] No, it is legitimate usage. See, for example, "Numerical Recipes in Pascal" by Press et al. When you know the popula

[issue21184] statistics.pvariance with known mean does not work as expected

2014-04-09 Thread Wolfgang Maier
Wolfgang Maier added the comment: I do not think this is a bug in the module, but rather incorrect usage. >From your own docs: data should be an iterable of Real-valued numbers, with at least one value. The optional argument mu, if given, should be the mean of the data. If it is miss

[issue21184] statistics.pvariance with known mean does not work as expected

2014-04-08 Thread Steven D'Aprano
New submission from Steven D'Aprano: If you know the population mean mu, you should calculate the sample variance by passing mu as an explicit argument to statistics.pvariance. Unfortunately, it doesn't work as designed: py> data = [1, 2, 2, 2, 3, 4] # sample from a population with mu=2.5 py>