Return the median (middle value) of numeric data, using the common “mean of middle two” method. If data is empty, StatisticsError is raised. data can be a sequence or iterable.
statistics.median(data)
>>> median([1, 3, 5])
3
>>> median([1, 3, 5, 7])
4.0