A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2013-August/128017.html below:

[Python-Dev] PEP 450 adding statistics module

[Python-Dev] PEP 450 adding statistics module [Python-Dev] PEP 450 adding statistics moduleSteven D'Aprano steve at pearwood.info
Fri Aug 16 12:03:53 CEST 2013
On 16/08/13 17:47, Oscar Benjamin wrote:
> I can't think of a situation where 1 or 2 modes are acceptable but 3
> is not. The only forms I can imagine using are mode(data) to get the
> unique mode if it exists and mode(data, max_modes=None) to get the set
> of all modes.

Hmmm, I think you are right. The current design is leftover from when mode also supported continuous data, and it made more sense there.


> But for that usage it would be better to have a boolean
> flag and then either way you're at the point where it would normally
> become two functions.

Alright, you've convinced me. I'll provide two functions: mode, which returns the single value with the highest frequency, or raises; and a second function, which collates the data into a sorted (value, frequency) list. Bike-shedding on the name of this second function is welcomed :-)



-- 
Steven
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4