I have a dataframe like this:
index value timestamp
1 A 2 03/01/2019
2 B 3 03/01/2019
3 C 5 03/01/2019
4 D 8 03/01/2019
5 A 2 03/02/2019
6 B 12 03/02/2019
7 C 4 03/02/2019
8 D 3 03/02/2019
9 A 2 03/03/2019
10 B 1 03/03/2019
11 C 1 03/03/2019
12 D 2 03/03/2019
I would like to add new rows "B+C" and sum the "value" filed within each timestamp. Here is the intended output:
index value timestamp
1 A 2 03/01/2019
2 B+C 8 03/01/2019
3 D 8 03/01/2019
4 A 2 03/02/2019
5 B+C 16 03/02/2019
6 D 3 03/02/2019
7 A 2 03/03/2019
8 B+C 2 03/03/2019
9 D 2 03/03/2019