I am working on a problem that returns maximum occurring elements in a list.
I am able to achieve this using mode in statistics. But when there are more than one element that repeats most, the mode function is throwing StatisticsError. How do I get number of mode values in the list.
I have a list
[1,1,1,2,2,2,3,3,4,4]
1's - 3
2's - 3
3's - 2
4's - 2
Here, most repeated elements are 1 and 2. Both are repeated thrice which is maximum occurrences for any number in the list.
How do I get 1 and 2s in a separate list. Is there any function to do that? Or Am I looking at it the wrong way?