Skip to content

Commit a0f82dd

Browse files
[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 fefd5d9) Co-authored-by: Mariusz Felisiak <[email protected]>
1 parent bbb1a8e commit a0f82dd

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Doc/library/statistics.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -449,9 +449,9 @@ However, for reading convenience, most of the examples show sorted sequences.
449449
variance indicates that the data is spread out; a small variance indicates
450450
it is clustered closely around the mean.
451451

452-
If the optional second argument *mu* is given, it is typically the mean of
453-
the *data*. It can also be used to compute the second moment around a
454-
point that is not the mean. If it is missing or ``None`` (the default),
452+
If the optional second argument *mu* is given, it should be the *population*
453+
mean of the *data*. It can also be used to compute the second moment around
454+
a point that is not the mean. If it is missing or ``None`` (the default),
455455
the arithmetic mean is automatically calculated.
456456

457457
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.
521521
the data is spread out; a small variance indicates it is clustered closely
522522
around the mean.
523523

524-
If the optional second argument *xbar* is given, it should be the mean of
525-
*data*. If it is missing or ``None`` (the default), the mean is
524+
If the optional second argument *xbar* is given, it should be the *sample*
525+
mean of *data*. If it is missing or ``None`` (the default), the mean is
526526
automatically calculated.
527527

528528
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.
538538
>>> variance(data)
539539
1.3720238095238095
540540

541-
If you have already calculated the mean of your data, you can pass it as the
542-
optional second argument *xbar* to avoid recalculation:
541+
If you have already calculated the sample mean of your data, you can pass it
542+
as the optional second argument *xbar* to avoid recalculation:
543543

544544
.. doctest::
545545

0 commit comments

Comments
 (0)