The max on collections.Counter
is counter intuitive, I want to find the find the character that occurs the most in a string.
>>> from collections import Counter
>>> c = Counter('aaaabbbcc')
>>> max(c)
'c'
>>> c
Counter({'a': 4, 'b': 3, 'c': 2})
I know I should be using most_common
, but its use seems contrived.
>>> c.most_common(1)[0][0]
'a'
Is there a case for supporting max on Counter ?