I would like to transform a list of dates in the following format:
01-02-12
01-03-12
01-27-12
02-01-12
02-23-12
.
.
.
01-03-13
02-02-13
as
1
1
1
2
2
.
.
.
13
14
ie: index each date by month, with respect to year also.
I am not sure how to do this and can't find a similar problem, so advice would be appreciated. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Edit: In response to @Psidom. Just an example dataset with made up numbers. In the actual dataset I'm dealing with I've transformed the dates to datetime objects.
dat = pd.read_csv('matchdata-update.csv',encoding = "ISO-8859-1")
dat['Date']=pd.to_datetime(dat['Date'],format='%m-%d-%y% I:%M%p').
Ideally I would like it to count a month , even if it was not observed. End goal is to index each month and to count number of rows in that insex, so if no month was observed then the number of rows counted for that index would just be 0.