Author DavidMertz
Recipients DavidMertz, dcasmr, eric.smith, maheshwark97, mark.dickinson, steven.daprano
Date 2019-01-07.03:57:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1546833461.88.0.753365697707.issue33084@roundup.psfhosted.org>
In-reply-to
Content
I believe that the current behavior of `statistics.median[|_low|_high\]` is simply broken.  It relies on the particular behavior of Python sorting, which only utilizes `.__lt__()` between objects, and hence does not require a total order.

I can think of absolutely no way to characterize these as reasonable results:

Python 3.7.1 | packaged by conda-forge | (default, Nov 13 2018, 09:50:42)
>>> statistics.median([9, 9, 9, nan, 1, 2, 3, 4, 5])
1
>>> statistics.median([9, 9, 9, nan, 1, 2, 3, 4])
nan
History
Date User Action Args
2019-01-07 03:57:43DavidMertzsetrecipients: + DavidMertz, mark.dickinson, eric.smith, steven.daprano, maheshwark97, dcasmr
2019-01-07 03:57:41DavidMertzsetmessageid: <1546833461.88.0.753365697707.issue33084@roundup.psfhosted.org>
2019-01-07 03:57:41DavidMertzlinkissue33084 messages
2019-01-07 03:57:41DavidMertzcreate