I have a long list values like below and am thinking of converting this to a dictionary. I would like to create dictionaries in python where for each key 0, 1, 2,...(say n), the value is sum of all values that belong to that key. For example,
0 -29.8568331501
1 -27.4866699437
2 -27.1228643508
0 -10.8685684486
1 -9.41353774283
2 -10.3218886291
...
Then,
dict = {0: SUM(-29.8568331501+-10.8685684486+..), 1:SUM(-27.4866699437+-9.41353774283+..), 2:1:SUM(-27.1228643508+-10.3218886291+..)}
I am a python newbie and would appreciate any guidance on how to go about doing this.