My date in my column looks like this:
9999-12-31 00:00:00
Because of the time stamp i can’t use errors =’coerse’ because it will convert this to NaT value, and i want to keep my values.
This small code turns keeps my date and time, and now i to convert it to an datetime64( the data type is an object)
adr_df['HIS_TS_END'] = adr_df['HIS_TS_END'].apply(lambda x: datetime.datetime.strptime(x,'%Y-%m-%d %H:%M:%S.%f') if type(x)==str else pd.NaT)
print(type(adr_df.iloc[0][1]))
1