Relative Content

Tag Archive for pythondataframegroup-by

sum groupby and add or sub row before to groupby and add row after to groupby

I have a dataframe and I would like to get summing values for every [group] with one row Values before (‘subtract’ & ‘add’) and one row after (‘BEGUZE_UE’) the group. (A group can contain different strings, UE_1 doesn’t matter).
But I get some wrong results in ‘m_days’. Thanks for any help.