I have DataFrame like below:
rng = pd.date_range('2020-12-01', periods=5, freq='D')
df = pd.DataFrame({"ID" : [1, 2, 2, 1, 3],
"status" : ["acc", "rem", "rem", "acc", "other"], "date" : rng})
And I need to create DataFrame with columns:
- New1 = amount of the days from the last "acc" agreemtn until today 28.12
- New2 = amount of the days from the last "rem" agreement until today 28.12
Result like below:

24and25come? Can you please explain the logic?