How to Find Middle Number of Some Numbers in Python


In this example, we will learn how to find the middle number of some numbers using the NumPy median() method in Python.

Source Code

import numpy as np

num = [15, 20, 18, 32, 25, 28, 19, 22]

median_num = np.median(num)

print(median_num)

Output:

21.0
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments