The date variable in my data is in multiple formats like DD/MM/YYYY D/MM/YY DD/M/YYYY 12/8/2017 27/08/17 8/9/2017 10/9/2017 15/09/17..
I need to change these multiple formats into one single format like DD/MM/YYYY
Tried to create a parsing function
def parse_date(date):
if date == '':
return None
else:
return dt.strptime(date, '%d/%m/%y').date()
and when I apply this function to my dataset, it throws me the following error..
"ValueError Traceback (most recent call last) in () ----> 1 data.Date = data.Date.apply(parse_date)
Unconverted Data Remains Error ValueError: unconverted data remains: 17"
How can I solve the unconverted data remains error?
%ydoesn't like the 2 digit year.