bpo-43147: Remove archaic terminology. (GH-24462)

This commit is contained in:
Raymond Hettinger 2021-02-07 16:44:42 -08:00 committed by GitHub
parent 206cbdab16
commit 30a8b28396
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 10 deletions

View file

@ -162,15 +162,14 @@ However, for reading convenience, most of the examples show sorted sequences.
real-valued numbers. If *weights* is omitted or *None*, then real-valued numbers. If *weights* is omitted or *None*, then
equal weighting is assumed. equal weighting is assumed.
The harmonic mean, sometimes called the subcontrary mean, is the The harmonic mean is the reciprocal of the arithmetic :func:`mean` of the
reciprocal of the arithmetic :func:`mean` of the reciprocals of the reciprocals of the data. For example, the harmonic mean of three values *a*,
data. For example, the harmonic mean of three values *a*, *b* and *c* *b* and *c* will be equivalent to ``3/(1/a + 1/b + 1/c)``. If one of the
will be equivalent to ``3/(1/a + 1/b + 1/c)``. If one of the values values is zero, the result will be zero.
is zero, the result will be zero.
The harmonic mean is a type of average, a measure of the central The harmonic mean is a type of average, a measure of the central
location of the data. It is often appropriate when averaging location of the data. It is often appropriate when averaging
rates or ratios, for example speeds. ratios or rates, for example speeds.
Suppose a car travels 10 km at 40 km/hr, then another 10 km at 60 km/hr. Suppose a car travels 10 km at 40 km/hr, then another 10 km at 60 km/hr.
What is the average speed? What is the average speed?

View file

@ -367,10 +367,9 @@ def geometric_mean(data):
def harmonic_mean(data, weights=None): def harmonic_mean(data, weights=None):
"""Return the harmonic mean of data. """Return the harmonic mean of data.
The harmonic mean, sometimes called the subcontrary mean, is the The harmonic mean is the reciprocal of the arithmetic mean of the
reciprocal of the arithmetic mean of the reciprocals of the data, reciprocals of the data. It can be used for averaging ratios or
and is often appropriate when averaging quantities which are rates rates, for example speeds.
or ratios, for example speeds.
Suppose a car travels 40 km/hr for 5 km and then speeds-up to Suppose a car travels 40 km/hr for 5 km and then speeds-up to
60 km/hr for another 5 km. What is the average speed? 60 km/hr for another 5 km. What is the average speed?