0
in: 
df.date

out:
0 1987-06-24 00:00:00
1 19910922

I have a pandas column that is a mix of integer and DateTime types. I am trying to convert the integer values into datetime.

Usually the column is only integers, and I use df.date= pd.to_datetime((df.date.astype(str)), format='%Y%m%d') to convert the column into a datetime format.

How do I handle this when some datetime values are thrown into the column?

Gen Tan
  • 858
  • 1
  • 11
  • 26
  • did you have a look [here](https://stackoverflow.com/questions/26920871/handling-pandas-dataframe-columns-with-mixed-date-formats) – Jeril Mar 26 '19 at 05:55
  • Yes, couldnt find a way to use `errors` – Gen Tan Mar 26 '19 at 06:01
  • 1
    Answer found here https://stackoverflow.com/questions/48180685/changing-all-dates-to-standard-date-time-in-dataframe – Gen Tan Mar 26 '19 at 06:13

0 Answers0