this continues , already cleaned the data removed missing vars, looked around and could not find a solution, thank you
datetime_str =fires.ALARM_DATE[1]
print(datetime_str)
outputs -> 2007-10-22 00:00:00
want to convert the column using
fires['CONT_DATE'] = pd.to_datetime(fires['CONT_DATE'], format ='%Y-%m-%d %H:%M:%S')
TypeError: Unrecognized value type: <class 'str'>
CodePudding user response:
There is no mistake in your method of use. The real mistake is because of "pandas.tslib.OutOfBoundsDatetime: Out of bounds nanosecond timestamp:"
If 'coerce', then invalid parsing will be set as NaT.
pd.to_datetime(date_col_to_force, errors = 'coerce')