compute difference in dates after groupby

36

df['diff'] = df.groupby('Type')['Date'].apply(lambda x: x.dt.date - x.min().date())

Comments

Submit
0 Comments