def after_purchase(rows):
    is_purchase = rows.type_ == 'Purchase'
purchase_times = rows.loc[is_purchase, 'time']
first_purchase_time = purchase_times.min()
return rows.loc[rows.time > first_purchase_time]
Python - Return rows after a certain date where a condition is met