I have been working with a dataframe in python and pandas that contains duplicate entries in the first column. The dataframe looks something like this:
sampl
Groupby will work.
data.groupby('sample_id').mean()
You can then use reset_index() to make look exactly as you want.
reset_index()