I have DataFrame with clients' agreements like below:
rng = pd.date_range('2020-12-01', periods=5, freq='D')
df = pd.DataFrame({ "ID" : ["1", "2", "1", "2", "2"], "Date": rng})
And I need to create new DataFrame with calculation based on above df:
- New1 = amount of days from the first agreement until today (16.12)
- New2 = amount of days from the last agreement until today (16.12)
To be more precision I need to create df like below:
