Latest recipes by John Jensen http://code.activestate.com/recipes/users/98067/new/2001-03-12T00:12:35-08:00ActiveState Code RecipesCount items and sort by incidence (Python)
2001-03-12T00:12:35-08:00John Jensenhttp://code.activestate.com/recipes/users/98067/http://code.activestate.com/recipes/52231-count-items-and-sort-by-incidence/
<p style="color: grey">
Python
recipe 52231
by <a href="/recipes/users/98067/">John Jensen</a>
.
</p>
<p>I've often found it necessary to produce ascending or descending counts -- the most or least common words in a file, popular pages on a website, etc. This is a simple class that makes this easy.</p>