how to calculate mean median mode in python code example
Example 1: how to get median mode average of a python list
>>> import statistics
>>> statistics.multimode([4, 1, 2, 2, 3, 5, 4])
[4, 2]
>>> statistics.multimode(["few", "few", "many", "some", "many"])
['few', 'many']
>>> st.multimode([4, 1, 2, 2, 3, 5])
[2]
Example 2: how to get median mode average of a python list
>>> import statistics
>>> statistics.mode([4, 1, 2, 2, 3, 5])
2
>>> statistics.mode([4, 1, 2, 2, 3, 5, 4])
4
>>> statistics.mode(["few", "few", "many", "some", "many"])
'few'