Pandas: How can I remove duplicate rows from DataFrame and calculate their frequency?,"df1.groupby(['key', 'year']).size().reset_index()"