I have an excel sheet with a column that is supposed to contain date values but pandas reads it as float64. It has blanks
df:
date_int
15022016
23072017
I want to convert to a datetime object. I do:
df['date_int1'] = df['date_int'].astype(str).fillna('01011900')#To fill the blanks
df['date_int2']=pd.to_datetime(df['date_int1'],format='%d%m%Y')
I get error while converting to datetime:
TypeError: Unrecognized value type: <class 'str'>
ValueError: unconverted data remains: .0