I have a list of dictionaries
lst = [ {'x': 1, 'y': 2}, {'x': 1, 'y': 3 }, {'x': 2, 'y': 2 } ]
Dictionaries always have the same keys and it is the values that change at all times.
So I would like to sum the value of the keys "y" when the key "x" has the same value.
The output should give:lst # [{'x': 1, 'y': 5 }, {'x': 2, 'y': 2 }].