Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-64588: Clarify the difference between mu and xbar in statistics docs. #117333

Merged
merged 1 commit into from
Apr 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Doc/library/statistics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -500,9 +500,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
Expand Down Expand Up @@ -572,8 +572,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
Expand All @@ -589,8 +589,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::

Expand Down
Loading