This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author gerion
Recipients gerion
Date 2017-07-23.22:10:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1500847822.23.0.66362631161.issue30999@psf.upfronthosting.co.za>
In-reply-to
Content
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 elem: elem[0])
(3, 3)
```
This functions always choose a specific element of the list, so a "key" argument is meaningful.


Maybe such a parameter makes sense for mean() as well, if the return value always is the result itself, but this is another point:
```
>>> mean([(1, 2), (3, 3), (4, 1)], key=lambda elem: elem[0])
2.6666666666666665
```
History
Date User Action Args
2017-07-23 22:10:22gerionsetrecipients: + gerion
2017-07-23 22:10:22gerionsetmessageid: <1500847822.23.0.66362631161.issue30999@psf.upfronthosting.co.za>
2017-07-23 22:10:22gerionlinkissue30999 messages
2017-07-23 22:10:22gerioncreate