I essentially have this dataset, and I'd like to add/combine the points of each item where the userID is a duplicate.
I know its somewhere along the lines of for (a,b) in array but asking for assistance learning.
[{'userID': 'QzzucRibfSahbUGwr2PGuhFSU242', 'points': 254}, {'userID': '5lyU0TCyqRcTD3y7Rs2FGV8h2Sd2', 'points': 268}, {'userID': 'QzzucRibfSahbUGwr2PGuhFSU242', 'points': 278}, {'userID': 'QzzucRibfSahbUGwr2PGuhFSU242', 'points': 254}]
Result should be
[{'userID': 'QzzucRibfSahbUGwr2PGuhFSU242', 'points': 786},
{'userID': '5lyU0TCyqRcTD3y7Rs2FGV8h2Sd2', 'points': 268}
]
Appreciate you guys and SO.