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 remi.lapeyre
Recipients jfine2358, josh.r, remi.lapeyre, vstinner
Date 2019-01-10.15:30:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1547134227.97.0.608624846213.issue35698@roundup.psfhosted.org>
In-reply-to
Content
> As a secondary school student, knowing the definition of median, I might expect the value to be 2, for any n > 0.

The secondary school student would be wrong, wouldn't he?

The median of a set is not expected to be a part of the set. Especially for ints since division by 1 or 2 is not closed for integers.

Would the same student expect median([2, 4, 6, 8]) to be part of the set of even integers?

I think one taking the median of a set should always ready to deal with floating point arithmetic the result is not guaranteed to be an integer. Going from hoops to make it so when it is equivalent to an integer is rather misleading.
History
Date User Action Args
2019-01-10 15:30:29remi.lapeyresetrecipients: + remi.lapeyre, vstinner, josh.r, jfine2358
2019-01-10 15:30:27remi.lapeyresetmessageid: <1547134227.97.0.608624846213.issue35698@roundup.psfhosted.org>
2019-01-10 15:30:27remi.lapeyrelinkissue35698 messages
2019-01-10 15:30:27remi.lapeyrecreate