Im trying to merge two lists that have a common thing between them (in that case is a the id parameter). I have something like this:
id
list1=[(id1,host1
>>> d = defaultdict(set) >>> d['id'].add('host1') >>> d['id'].add('host2') >>> d['id'].add('host1') >>> d defaultdict(, {'id': set(['host2', 'host1'])})