I have a dataset with personal data such as name, height, weight and date of birth. I would build a graph with the number of people born in a particular month and year. I\'m
Replace date and count fields with your respective column names. This piece of code will group, sum and sort based on the given parameters. You can also change the frequency to 1M or 2M and so on...
df[['date', 'count']].groupby(pd.Grouper(key='date', freq='1M')).sum().sort_values(by='date', ascending=True)['count']