I have a python dictionary, which looks like this.
{ \'item1\' : [1,2,3,4,5,6],
\'item2\' : [2,3,1],
.
.
.
\'item n\' : [4,2,4,3,2]
}
You could create the dictionary with the sums on-the-fly:
Result = dict([(key, sum(values)) for key, values in yourDict.items()])
# or...
Result = {key: sum(values) for key, values in yourDict.items()}
Here, the values of the new dictionary will be numbers, but if you really need them to be lists, you could enclose the call to sum in square brackets: [sum(values)].