Probably a naive question, but new to it.
I have a dataset having multiple date entries. I want to create a new dataframe such that it has 2 columns, date and count.
My dataset looks like this :
Date
01/01/2020
01/10/2019
01/11/2019
01/12/2019
02/01/2020
02/10/2019
02/11/2019
02/12/2019
03/01/2020
03/10/2019
03/11/2019
03/12/2019
04/01/2020
04/10/2019
04/11/2019
04/12/2019
05/01/2020
05/10/2019
05/11/2019
05/12/2019
06/01/2020
I have tried :
import pandas as pd
count = df.groupby(['Date']).count()
But it is just returning me the dates grouped by and not the count.
the expected output is :
Date Count
Since the dates are repeated in the dataset, each date should represent the same count. i.e. if 01/01/2020 has 5 entries then it should have count as 5 in all 5 entries.
Can anyone help.
Thanks