{"id":25466,"date":"2021-11-16T08:39:28","date_gmt":"2021-11-16T03:09:28","guid":{"rendered":"https:\/\/python-programs.com\/?p=25466"},"modified":"2021-11-16T08:39:28","modified_gmt":"2021-11-16T03:09:28","slug":"python-statistics-median_high-method-with-examples","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-statistics-median_high-method-with-examples\/","title":{"rendered":"Python statistics.median_high() Method with Examples"},"content":{"rendered":"

statistics.median_high() Method in Python:<\/strong><\/p>\n

The statistics.median_high() method computes the data set’s high median. Before calculating the high median, the data is also sorted in ascending order using this method.<\/p>\n

Note:<\/strong> It should be noted that if the number of data values is odd, it will return the exact middle value. If there are an even number of data values, it returns the larger of the two middle values.<\/p>\n

Syntax:<\/strong><\/p>\n

statistics.median_high(data)<\/pre>\n

Parameters<\/strong><\/p>\n

data:<\/strong> This is Required. It is the data values that will be used (it can be any sequence, list, or iterator).<\/p>\n

Note:<\/strong> It is to be noted that if the data is empty, it returns a StatisticsError.<\/p>\n

Return Value:<\/strong><\/p>\n

Returns a\u00a0float value representing the data’s high median (middle value).<\/p>\n

Examples:<\/strong><\/p>\n

Example1:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given list = [10, 20, 40, 15, 30, 13, 17]<\/pre>\n

Output:<\/strong><\/p>\n

The high median of the given list items [10, 20, 40, 15, 30, 13, 17] =  17<\/pre>\n

Example2:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given list = [2, 1, 3, 5, 7, 8]<\/pre>\n

Output:<\/strong><\/p>\n

The high median of the given list items [2, 1, 3, 5, 7, 8] = 5<\/pre>\n

statistics.median_high() Method with Examples in Python<\/span><\/p>\n