What is the best way of establishing the sum of all counts in a collections.Counter object?
The code you have adds up the keys (i.e. the unique values in the list:
To add up the counts, use:
In : sum(Counter([1,2,3,4,5,1,2,1,6]).values()) Out: 9
This idiom is mentioned in the documentation, under "Common patterns".