diff options
author | Raymond Hettinger <rhettinger@users.noreply.github.com> | 2019-11-12 07:35:06 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-12 07:35:06 (GMT) |
commit | 733b9a308e3c49855888e2e12397ae56d831e780 (patch) | |
tree | 14b13aac1fe22da48e9d740ae8de07f82548f388 /Doc | |
parent | 051ff526b5dc2c40c4a53d87089740358822edfa (diff) | |
download | cpython-733b9a308e3c49855888e2e12397ae56d831e780.zip cpython-733b9a308e3c49855888e2e12397ae56d831e780.tar.gz cpython-733b9a308e3c49855888e2e12397ae56d831e780.tar.bz2 |
bpo-38385: Fix iterator/iterable terminology in statistics docs (GH-17111)
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/statistics.rst | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Doc/library/statistics.rst b/Doc/library/statistics.rst index 00c0b53..a790ed8 100644 --- a/Doc/library/statistics.rst +++ b/Doc/library/statistics.rst @@ -77,7 +77,7 @@ However, for reading convenience, most of the examples show sorted sequences. .. function:: mean(data) - Return the sample arithmetic mean of *data* which can be a sequence or iterator. + Return the sample arithmetic mean of *data* which can be a sequence or iterable. The arithmetic mean is the sum of the data divided by the number of data points. It is commonly called "the average", although it is only one of many @@ -122,7 +122,7 @@ However, for reading convenience, most of the examples show sorted sequences. Convert *data* to floats and compute the arithmetic mean. This runs faster than the :func:`mean` function and it always returns a - :class:`float`. The *data* may be a sequence or iterator. If the input + :class:`float`. The *data* may be a sequence or iterable. If the input dataset is empty, raises a :exc:`StatisticsError`. .. doctest:: @@ -143,7 +143,7 @@ However, for reading convenience, most of the examples show sorted sequences. Raises a :exc:`StatisticsError` if the input dataset is empty, if it contains a zero, or if it contains a negative value. - The *data* may be a sequence or iterator. + The *data* may be a sequence or iterable. No special efforts are made to achieve exact results. (However, this may change in the future.) @@ -158,7 +158,7 @@ However, for reading convenience, most of the examples show sorted sequences. .. function:: harmonic_mean(data) - Return the harmonic mean of *data*, a sequence or iterator of + Return the harmonic mean of *data*, a sequence or iterable of real-valued numbers. The harmonic mean, sometimes called the subcontrary mean, is the @@ -202,7 +202,7 @@ However, for reading convenience, most of the examples show sorted sequences. Return the median (middle value) of numeric data, using the common "mean of middle two" method. If *data* is empty, :exc:`StatisticsError` is raised. - *data* can be a sequence or iterator. + *data* can be a sequence or iterable. The median is a robust measure of central location and is less affected by the presence of outliers. When the number of data points is odd, the @@ -231,7 +231,7 @@ However, for reading convenience, most of the examples show sorted sequences. .. function:: median_low(data) Return the low median of numeric data. If *data* is empty, - :exc:`StatisticsError` is raised. *data* can be a sequence or iterator. + :exc:`StatisticsError` is raised. *data* can be a sequence or iterable. The low median is always a member of the data set. When the number of data points is odd, the middle value is returned. When it is even, the smaller of @@ -251,7 +251,7 @@ However, for reading convenience, most of the examples show sorted sequences. .. function:: median_high(data) Return the high median of data. If *data* is empty, :exc:`StatisticsError` - is raised. *data* can be a sequence or iterator. + is raised. *data* can be a sequence or iterable. The high median is always a member of the data set. When the number of data points is odd, the middle value is returned. When it is even, the larger of @@ -272,7 +272,7 @@ However, for reading convenience, most of the examples show sorted sequences. Return the median of grouped continuous data, calculated as the 50th percentile, using interpolation. If *data* is empty, :exc:`StatisticsError` - is raised. *data* can be a sequence or iterator. + is raised. *data* can be a sequence or iterable. .. doctest:: @@ -381,7 +381,7 @@ However, for reading convenience, most of the examples show sorted sequences. .. function:: pvariance(data, mu=None) - Return the population variance of *data*, a non-empty sequence or iterator + Return the population variance of *data*, a non-empty sequence or iterable of real-valued numbers. Variance, or second moment about the mean, is a measure of the variability (spread or dispersion) of data. A large variance indicates that the data is spread out; a small variance indicates |