Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fefd5d9

Browse files
authored
gh-64588: Clarify the difference between mu and xbar in statistics docs (#117333)
Thanks Davin Potts for the clarification idea.
1 parent 6099fdf commit fefd5d9

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
@@ -501,9 +501,9 @@ However, for reading convenience, most of the examples show sorted sequences.
501501
variance indicates that the data is spread out; a small variance indicates
502502
it is clustered closely around the mean.
503503

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

509509
Use this function to calculate the variance from the entire population. To
@@ -573,8 +573,8 @@ However, for reading convenience, most of the examples show sorted sequences.
573573
the data is spread out; a small variance indicates it is clustered closely
574574
around the mean.
575575

576-
If the optional second argument *xbar* is given, it should be the mean of
577-
*data*. If it is missing or ``None`` (the default), the mean is
576+
If the optional second argument *xbar* is given, it should be the *sample*
577+
mean of *data*. If it is missing or ``None`` (the default), the mean is
578578
automatically calculated.
579579

580580
Use this function when your data is a sample from a population. To calculate
@@ -590,8 +590,8 @@ However, for reading convenience, most of the examples show sorted sequences.
590590
>>> variance(data)
591591
1.3720238095238095
592592

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

596596
.. doctest::
597597

0 commit comments

Comments
 (0)