The Python statistics.median_low() function calculates the low median of the given data set. Before calculating the low median, this function sorts the data in ascending order.
Note: In this function, if the data values are odd, it returns the middle value; otherwise, it returns a smaller value from the two middle numbers.
SyntaxFollowing is the basic syntax of the statistics.median_low() function −
statistics.median_low(data)Parameters
Here, the data values can be used as any sequence, list or iterator.
Return ValueThis function returns the middle value in the given data.
Example 1In the below example, we are calculating the low median of the given data using statistics.median_low() function.
import statistics x = statistics.median_low([2, 4, 6, 8, 10]) print(x)Output
The output obtained is as follows −
6Example 2
Now, we are calculating the low median for the negative even numbers using statistics.median_low() function.
import statistics x = statistics.median_low([-2, 4, -0.6, 8.3, 10, -11]) print(x)Output
We will get the output as follows −
-0.6Example 3
Here, we are calculating the low median for the given data using the statistics.median_low() function.
import statistics x = statistics.median_low([1, 3, 5, 7, 9, 11]) print(x)Output
The result is obtained as follows −
5
python_modules.htm
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4