statistics.median_high()

statistics.median_high(data)

Return the high median of data. If data is empty, StatisticsError is raised.

The high median is always a member of the data set. When the number of data points is odd, the middle value is returned. When it is even, the larger of the two middle values is returned.

>>> median_high([1, 3, 5])
3
>>> median_high([1, 3, 5, 7])
5

Use the high median when your data are discrete and you prefer the median to be an actual data point rather than interpolated.

doc_python
2016-10-07 17:43:03
Comments
Leave a Comment

Please login to continue.