Answers for "python dt error only use with datetimelike values"

0

python dt error only use with datetimelike values

# Your problem here may be that to_datetime silently failed so the dtype remained as str/object, 
# if you set param errors='coerce' then if the conversion fails for any particular string 
# then those rows are set to NaT.

df['Date'] = pd.to_datetime(df['Date'], errors='coerce')
Posted by: Guest on May-11-2021

Code answers related to "python dt error only use with datetimelike values"

Python Answers by Framework

Browse Popular Code Answers by Language