remove duplicate rows from dataframe `df1` and calculate their frequency,"df1.groupby(['key', 'year']).size().reset_index()"