![](https://secure.gravatar.com/avatar/9e2eb3b03ecdd58335641d434859e6a6.jpg?s=120&d=mm&r=g)
June 5, 2013
7:16 p.m.
Hello, It seems that I found micro bug in Python documentation describing collections.Counter class<http://docs.python.org/3.3/library/collections.html#counter-objects> . There is the following snippet of code c.most_common()[:-n:-1] # n least common elements Actually this expression returns not *n* least common elements, but rather *n - 1,* beacuse second boundary is not included (as usual with slices). You probably meant c.most_common()[-n:] or c.most_common()[:-n-1:-1] if reverse ordering is nesessary. -- Best regards Mikhail Golubev