I\'m hoping to groupby users and find the first two uploads. I\'ve figured out how to get the first date via minimum, but I\'m having trouble getting that second upload date. Th
Since the other answers explain pretty well how to achieve this, I'll give you a one-liner for a change
In [1]: df.groupby('User_ID').apply(lambda g: g.sort_values('Date_Uploaded')['Date_Uploaded'][:2].diff()).mean() Out[1]: Timedelta('21 days 12:00:00')