compute difference in dates after groupby

48

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

Comments

Submit
0 Comments