How to find mean, median, and mode in Python using statistics code example
Example 1: 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
Example 2: mean median mode using python
from scipy import stats
speed =
[99,86,87,88,111,86,103,87,94,78,77,85,86]
x = stats.mode(speed)
print(x)