[Python-checkins] Add examples to elucidate the formulas (GH-14898)

Raymond Hettinger webhook-mailer at python.org
Sun Jul 21 19:32:04 EDT 2019


https://github.com/python/cpython/commit/b530a4460b7a6ea96f1fa81a7c5bb529ead574ef
commit: b530a4460b7a6ea96f1fa81a7c5bb529ead574ef
branch: master
author: Raymond Hettinger <rhettinger at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2019-07-21T16:32:00-07:00
summary:

Add examples to elucidate the formulas (GH-14898)

files:
M Doc/library/statistics.rst

diff --git a/Doc/library/statistics.rst b/Doc/library/statistics.rst
index bc841fda72f8..a906a591e62c 100644
--- a/Doc/library/statistics.rst
+++ b/Doc/library/statistics.rst
@@ -527,14 +527,18 @@ However, for reading convenience, most of the examples show sorted sequences.
    The default *method* is "exclusive" and is used for data sampled from
    a population that can have more extreme values than found in the
    samples.  The portion of the population falling below the *i-th* of
-   *m* data points is computed as ``i / (m + 1)``.
+   *m* sorted data points is computed as ``i / (m + 1)``.  Given nine
+   sample values, the method sorts them and assigns the following
+   percentiles: 10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, 90%.
 
    Setting the *method* to "inclusive" is used for describing population
-   data or for samples that include the extreme points.  The minimum
-   value in *dist* is treated as the 0th percentile and the maximum
-   value is treated as the 100th percentile.  The portion of the
-   population falling below the *i-th* of *m* data points is computed as
-   ``(i - 1) / (m - 1)``.
+   data or for samples that are known to include the most extreme values
+   from the population.  The minimum value in *dist* is treated as the 0th
+   percentile and the maximum value is treated as the 100th percentile.
+   The portion of the population falling below the *i-th* of *m* sorted
+   data points is computed as ``(i - 1) / (m - 1)``.  Given 11 sample
+   values, the method sorts them and assigns the following percentiles:
+   0%, 10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, 90%, 100%.
 
    If *dist* is an instance of a class that defines an
    :meth:`~inv_cdf` method, setting *method* has no effect.



More information about the Python-checkins mailing list