Find and process duplicates in list of lists
It looks like you could use collections.Counter. Although you may want to use it earlier in your code, when you create the list of pairs you pass to dedupe. As is, you could use the following in your code:

from collections import Counter

def dedupe(data):
    result = Counter()
    for row in data:
        result.update(dict([row]))
    return result.items()

&gt;&gt;&gt; data = [['foo',1], ['bar',3],['foo',4]]
&gt;&gt;&gt; dedupe(data)
[('foo', 5), ('bar', 3)]