using cumsum in pandas on group(),"data1.groupby(['Bool', 'Dir']).apply(lambda x: x['Data'].cumsum())"