diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2024-04-19 05:42:35 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-19 05:42:35 (GMT) |
commit | a0f82dd6ccddc5fd3266df8ba55496ab573aacf2 (patch) | |
tree | 25eb6a7bebd23eef5a3656c73eb0bf6dd27550e8 | |
parent | bbb1a8e7686353e1ae848ee77453195d1a6373e4 (diff) | |
download | cpython-a0f82dd6ccddc5fd3266df8ba55496ab573aacf2.zip cpython-a0f82dd6ccddc5fd3266df8ba55496ab573aacf2.tar.gz cpython-a0f82dd6ccddc5fd3266df8ba55496ab573aacf2.tar.bz2 |
[3.12] gh-64588: Clarify the difference between mu and xbar in statistics docs (GH-117333) (#118080)
gh-64588: Clarify the difference between mu and xbar in statistics docs (GH-117333)
Thanks Davin Potts for the clarification idea.
(cherry picked from commit fefd5d97111364afa027ae580c3244f427dda59d)
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
-rw-r--r-- | Doc/library/statistics.rst | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Doc/library/statistics.rst b/Doc/library/statistics.rst index d0274e8..4a3a896 100644 --- a/Doc/library/statistics.rst +++ b/Doc/library/statistics.rst @@ -449,9 +449,9 @@ However, for reading convenience, most of the examples show sorted sequences. variance indicates that the data is spread out; a small variance indicates it is clustered closely around the mean. - If the optional second argument *mu* is given, it is typically the mean of - the *data*. It can also be used to compute the second moment around a - point that is not the mean. If it is missing or ``None`` (the default), + If the optional second argument *mu* is given, it should be the *population* + mean of the *data*. It can also be used to compute the second moment around + a point that is not the mean. If it is missing or ``None`` (the default), the arithmetic mean is automatically calculated. Use this function to calculate the variance from the entire population. To @@ -521,8 +521,8 @@ However, for reading convenience, most of the examples show sorted sequences. the data is spread out; a small variance indicates it is clustered closely around the mean. - If the optional second argument *xbar* is given, it should be the mean of - *data*. If it is missing or ``None`` (the default), the mean is + If the optional second argument *xbar* is given, it should be the *sample* + mean of *data*. If it is missing or ``None`` (the default), the mean is automatically calculated. Use this function when your data is a sample from a population. To calculate @@ -538,8 +538,8 @@ However, for reading convenience, most of the examples show sorted sequences. >>> variance(data) 1.3720238095238095 - If you have already calculated the mean of your data, you can pass it as the - optional second argument *xbar* to avoid recalculation: + If you have already calculated the sample mean of your data, you can pass it + as the optional second argument *xbar* to avoid recalculation: .. doctest:: |