How to make this groupby() cumsum() show only the last
cumsum() by its groupby(), in this new column?
df_dea['profit_usd'] = df_dea.groupby('key_br_acc_posid')['notional_usd'].cumsum()
if I insert a .last()
at the end of this code I get an error:
TypeError: last() missing 1 required positional argument: 'offset'