I have a dataframe that looks like:
param1 param2 num1 num2
A B 4 0.3
A C 5 0.1
A B 6 0.5
B F 3 0.7
C A 1 0.8
C A 2 1.1
and I want something like
param1 param2 num1 num2
A B 10 0.8
A C 5 0.1
B F 3 0.7
C A 3 1.9
If I use something like:
df.groupby(['param1', 'param2']).sum()
I end up with the columns 'param1' and 'param2' fused as an index, but I don't want that. I just need them to stay as they are, but if I have some lines with the same param1 and param2, sum the 'nums' associated to them.