My .csv data looks like this:
June 8, 2009 Monday
June 8, 2009 Monday
June 6, 2009 Saturday
June 6, 2009 Saturday Correction Appended
June 6, 2009 Saturday
June 6, 2009 Saturday
June 6, 2009 Saturday
etc...
The data spans 10 years. I need to separate the months and years (and don't care about the dates and days).
To single out months I have the next lines of code:
for row in reader:
date = row[1]
month = date.partition(' ')[0]
print month
However I can't figure out how to extract the numeric year from the string? Would I have to use regex for this?
monthisJune 6, then you can get6bymonth.split(" ")[1]