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, steven.daprano
Date 2017-07-24.01:46:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1500860763.43.0.847214535342.issue30999@psf.upfronthosting.co.za>
In-reply-to
Content
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])
```
median = median_low([(1, ['Anna']), (3, ['Paul', 'Henry']), (4, ['Kate'])], key=lambda elem: elem[0])
for name in median[1]:
    print(f"{name} is one of the people that reach the median score.")
```
or you can enumerate:
```
data = [1, 3, 4]
median = median_low(enumerate(data), key=lambda elem: elem[1])
print(f"median is at position {median[0]}")
```
With the keyword argument, the input can also be a list of self defined objects, where the median make sense on some member variable or function, etc.:
```
>>> median_low(list_of_self_defined_objects, key=lambda elem: elem.get_score())
```
History
Date User Action Args
2017-07-24 01:46:03gerionsetrecipients: + gerion, steven.daprano
2017-07-24 01:46:03gerionsetmessageid: <1500860763.43.0.847214535342.issue30999@psf.upfronthosting.co.za>
2017-07-24 01:46:03gerionlinkissue30999 messages
2017-07-24 01:46:03gerioncreate