Let’s see how to calculate high median in Python.
High median calculation
To calculate high median we need to import statistics module.
Luckily, there is a dedicated function in statistics module to calculate a high median.
import statistics as s x = [1, 5, 7, 8, 43, 6] median_high = s.median_high(x) print("Median high equals: " + str(round(median_high, 2)))