i have a result tuple of dictionaries.
result = ({\'name\': \'xxx\', \'score\': 120L }, {\'name\': \'xxx\', \'score\': 100L}, {\'name\': \'yyy\', \'score\':
How about...
inp = ({'name': 'xxx', 'score': 120L }, {'name': 'xxx', 'score': 100L}, {'name': 'yyy', 'score': 10L}) temp = {} for dct in inp: if dct['score'] > temp.get(dct['name']): temp[dct['name']] = dct['score'] result = tuple({'name': name, 'score': score} for name, score in temp.iteritems())