David Mertz <david.me...@gmail.com> added the comment:

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

----------
nosy: +David Mertz

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue33084>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to