In Python 2.7, I want to iterate over a collections.Counter
instance in descending count order.
>>> import collections
>>> c = co
Here is the example to iterate the Counter in Python collections:
>>>def counterIterator():
import collections
counter = collections.Counter()
counter.update(('u1','u1'))
counter.update(('u2','u2'))
counter.update(('u2','u1'))
for ele in counter:
print(ele,counter[ele])
>>>counterIterator()
u1 3
u2 3