News for hackers. Stuff that matters.
Re:Have you read your Python Docs Lately? by natnat on Sunday May 01, 2011 @03:32AM (#2502609)
Not to pick nits, but this is off by one. If you need the n most common elements, you should use

  c.most_common()[:-n-1:-1]
because the element at

  c.most_common()[-n]
is actually the n-1th most common element.

There are no comments on this comment yet.