how to find mean median and mode in python using numpy code example
Example 1: median of numpy array
arr = np.array([1, 2, 3, 4, 5])
np.median(arr)
Example 2: calculate mean median mode in python
>>> import statistics
>>> statistics.median([3, 5, 1, 4, 2])
3
>>> statistics.median([3, 5, 1, 4, 2, 6])
3.5