median

bandicoot.helper.maths.median(data)

Return the median of numeric data, unsing the "mean of middle two" method. If data is empty, 0 is returned.

Examples

>>> median([1, 3, 5])
3.0

When the number of data points is even, the median is interpolated: >>> median([1, 3, 5, 7]) 4.0