Problem with sort by and group by in pandas
All you need is a groupby operation + aggregation on the min/max values.


df.groupby('id').agg(('min','max'))['date_column']


The output should be like this : different dataframe with each line containing an id and the min/max dates.