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 W deW
Recipients W deW
Date 2018-05-18.19:29:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1526671785.76.0.682650639539.issue33573@psf.upfronthosting.co.za>
In-reply-to
Content
The 0.5-quantile or median is defined for ordinal, interval, and ratio scales. An Enumerator as derived from Enum and extended with rich comparison methods implements an ordinal scale. Therefore calculating the median over a list of such enum-elements ought to be possible.

The current implementation tries to interpolate the median value by averaging the two middle observations. This is allowed for interval and ratio scales, but since this interpolation involves an addition, not so for ordinal scales. Although computationally it is possible to do this for numeric ordinal variables, logically it is non-sense for the distance between ordinal values is - by definition - unknown. On non-numeric ordinal values it is even computationally impossible.

The correct return value would be: the first value in an ordered set where al least half the number of observations is smaller or equal than it. This is observation[len(observation)//2] for odd and even length ordered lists of values.

Whether the same applies to interval and ratio scales is a matter of opinion. The currently implemented algorith definitely is more popular these days.
History
Date User Action Args
2018-05-18 19:29:45W deWsetrecipients: + W deW
2018-05-18 19:29:45W deWsetmessageid: <1526671785.76.0.682650639539.issue33573@psf.upfronthosting.co.za>
2018-05-18 19:29:45W deWlinkissue33573 messages
2018-05-18 19:29:45W deWcreate