group_by(): pick one or more variables to group, then operate on them with summarise() or agg
group_by(): pick one or more variables to group, then operate on them with summarise() or agg
select(): grab only the columns passed as arguments or removed if passed as negative
mutate(): create a new column, it can be a function of other columns (see lapply, etc)
select(): grab only the columns passed as arguments or removed if passed as negative
mutate(): create a new column, it can be a function of other columns (see lapply, etc)
d1 = df[df['col_a']=='event_a'].iloc[0]['date']
d2 = df[df['col_b']=='event_b'].iloc[0]['date']
then just make d1 and d2 into datetimes if they are strings and subtract or use timedelta.
d1 = df[df['col_a']=='event_a'].iloc[0]['date']
d2 = df[df['col_b']=='event_b'].iloc[0]['date']
then just make d1 and d2 into datetimes if they are strings and subtract or use timedelta.