This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rhettinger
Recipients BreamoreBoy, Julian.Gindi, docs@python, rhettinger
Date 2014-06-19.20:05:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1403208328.14.0.390682688628.issue20068@psf.upfronthosting.co.za>
In-reply-to
Content
The introductory example already shows both ways of using a Counter:

1) How to tally one at a time:

   cnt = Counter()
   for word in ['red', 'blue', 'red', 'green', 'blue', 'blue']:
       cnt[word] += 1

2) How to count directly from a list:

    words = re.findall(r'\w+', open('hamlet.txt').read().lower())
    Counter(words).most_common(10)
History
Date User Action Args
2014-06-19 20:05:28rhettingersetrecipients: + rhettinger, docs@python, BreamoreBoy, Julian.Gindi
2014-06-19 20:05:28rhettingersetmessageid: <1403208328.14.0.390682688628.issue20068@psf.upfronthosting.co.za>
2014-06-19 20:05:28rhettingerlinkissue20068 messages
2014-06-19 20:05:27rhettingercreate