python for counter less code example
Example: python counter least common
import collections
c = collections.Counter(a=1, b=2, c=3)
n = 2
print c.most_common()[:-n-1:-1]Output[('a', 1), ('b', 2)]
import collections
c = collections.Counter(a=1, b=2, c=3)
n = 2
print c.most_common()[:-n-1:-1]Output[('a', 1), ('b', 2)]