Message298918
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
``` |
|
Date |
User |
Action |
Args |
2017-07-23 22:10:22 | gerion | set | recipients:
+ gerion |
2017-07-23 22:10:22 | gerion | set | messageid: <1500847822.23.0.66362631161.issue30999@psf.upfronthosting.co.za> |
2017-07-23 22:10:22 | gerion | link | issue30999 messages |
2017-07-23 22:10:22 | gerion | create | |
|