In brief
collections.Counter counts occurrences of hashable values. Counter(['tea', 'tea', 'coffee']) records two occurrences of tea and one of coffee.
Useful to know
collections.Counter counts occurrences of hashable values. Counter(['tea', 'tea', 'coffee']) records two occurrences of tea and one of coffee. [1]
It helps summarize labels or events after input preparation. Different spellings remain different keys. If the task requires case-insensitive grouping, define normalization before counting while retaining the originals where needed.
Sources
For further detail and to check the information: