I have a dataframe that looks like this (there are other columns which needs to be kept but untouched, they can be blank in the new row with assetClass = 99):
clientID date assetClass value
10111 01-01-2020 1 10
10111 01-01-2020 2 20
10111 01-01-2020 3 30
10111 02-01-2020 1 15
10111 02-01-2020 2 25
10111 02-01-2020 3 35
There are several clients and asset classes from 1-18. This is raw output from a system.
I need to create a new assetClass, call it 99, which consists of the sum of 2 and 3 (in reality 11-16), grouped by date and clientID, creating a dataframe looking like this:
clientID date assetClass value
10111 01-01-2020 1 10
10111 01-01-2020 2 20
10111 01-01-2020 3 30
10111 01-01-2020 99 50
10111 02-01-2020 1 15
10111 02-01-2020 2 25
10111 02-01-2020 3 35
10111 02-01-2020 99 60
I've googled like a mad man, but I think there's something lacking in my knowledge of what this process should be called.
I have gotten nowhere with my own attempts at solving it, so I have no relevant code to show - how do I do this?