The dataset contains 4 columns, where name is the name of the child, yearofbirth denotes the year in which the child was born, number represents the number of babies who were named with that particular name.
For example, entry 1 reads, in the year 1880, 7065 girl children were named Mary.
Through pandas, I`m trying to find out every year which name was the most used one. My code
df.groupby(['yearofbirth']).agg({'number':'max'}).reset_index()
The above code partially answers the question in hand.
I want to want the name along with the maximum number.