I have a string date. I know how to convert it to datetime.datetime object(when there is no missing!!!) but the problem is I have some missing values. And I couldn't do it.
let's say the input_date is the raw date variable which is string. I want to produce input_date_fmt variable which will be datetime.datetime .I am trying to run the following
DF['input_date_fmt'] = np.array([datetime.datetime.strptime(x, "%m/%d/%Y").date()
for x in DF['input_date']])
But the error is
ValueError: time data 'nan' does not match format '%m/%d/%Y'
Can anyone please help?