get mode in python code example
Example 1: statistics mode python when no.s are same
import statistics
statistics.mode(x) #mean and median are also available.
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