]> granicus.if.org Git - python/commitdiff
bpo-35892: Add usage note to mode() (GH-15122) (GH-15176)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 8 Aug 2019 08:36:55 +0000 (01:36 -0700)
committerRaymond Hettinger <rhettinger@users.noreply.github.com>
Thu, 8 Aug 2019 08:36:55 +0000 (01:36 -0700)
(cherry picked from commit e43e7ed36480190083740fd75e2b9cdca72f1a68)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
Doc/library/statistics.rst

index a906a591e62cef1bf251e766f41652f21d4818d2..1a19e374192159e51f1b9f90b0c47d047d3fdeb3 100644 (file)
@@ -313,7 +313,9 @@ However, for reading convenience, most of the examples show sorted sequences.
    measure of central location.
 
    If there are multiple modes, returns the first one encountered in the *data*.
-   If *data* is empty, :exc:`StatisticsError` is raised.
+   If the smallest or largest of multiple modes is desired instead, use
+   ``min(multimode(data))`` or ``max(multimode(data))``.  If the input *data* is
+   empty, :exc:`StatisticsError` is raised.
 
    ``mode`` assumes discrete data, and returns a single value. This is the
    standard treatment of the mode as commonly taught in schools: