Any users of statistics.mode() here?

Jason Friedman jsf80238 at gmail.com
Tue Feb 20 15:20:14 EST 2018


> statistics.mode() currently raises an exception if there is more than one
> mode.
>

I am an infrequent user of this package and this function.  My two cents:
* Leave the current behavior as-is.
* Continue to throw an exception for no data.
* Add an argument, named perhaps mutli=False, that if set to True causes
the function to a return a list of modes, including if there is only a
single mode.  statistics.mode((1, 2, 2, 3, 3, 4, 4, 5), multi=True) would
return [2, 3, 4].
* Would still throw StatisticsError if no data or if every element occurs
exactly the same number of times (for example,
statistics.mode(range(1000000000), multi=True))



More information about the Python-list mailing list