I have a list which has repeating items and I want a list of the unique items with their frequency.
For example, I have [\'a\', \'a\', \'b\', \'b\', \'b\']
[\'a\', \'a\', \'b\', \'b\', \'b\']
>>> mylist=['a', 'a', 'b', 'b', 'b'] >>> [ (i,mylist.count(i)) for i in set(mylist) ] [('a', 2), ('b', 3)]