Let’s see how to calculate high median in Python.
To calculate high median we need to import statistics module.
Luckily there is dedicated function in statistics module to calculate 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)))