[issue30999] statistics module: add "key" keyword argument to median, mode, ...

2017-07-24 Thread gerion
gerion added the comment: The position might be useful, if you have a second list with some side data stored in it, and not a list of tuples :). I had the idea to file a bug, when I had a list of coordinates and wanted to use the point with the median of the x-coordinates as "represent

[issue30999] statistics module: add "key" keyword argument to median, mode, ...

2017-07-23 Thread gerion
gerion added the comment: My use case is some side data somehow connected to the statistical relevant data. (I think, this is more less a similar use case as with the min and max function.) A few examples: The datastructure is a list of tuples: (score, [list of people that have this score

[issue30999] statistics module: add "key" keyword argument to median, mode, ...

2017-07-23 Thread gerion
New submission from gerion: With Python 3.4 the statistics module was added. It would be cool, if the functions: median_low() median_high() mode() would have a "key" keyword argument, just like in max() and min(): ``` >>> median_low([(1, 2), (3, 3), (4, 1)], key=lambda e