I have a csv file with a datetime field called "Reading Time" that looks like the following "2020-09-01 00:06:52 +0000 UTC".
When using any of the following to_datetime function in Pandas, I get the following error depending on the function arguments I use:
df['Reading Time'] = pd.to_datetime(df['Reading Time'], format='%Y-%m-%d %H:%M:%S')
df['Reading Time'] = pd.to_datetime(df['Reading Time'], format='%Y-%m-%d %H:%M:%S', exact=False)
df['Reading Time'] = pd.to_datetime(df['Reading Time'], format='%Y-%m-%d %H:%M:%S %Z')
df['Reading Time'] = pd.to_datetime(df['Reading Time'], format='%Y-%m-%d %H:%M:%S %Z', exact=False)
ValueError: time data 2020-09-01 00:06:52 +0000 UTC doesn't match format specified
If I then try the "coerce" argument...
df['Reading Time'] = pd.to_datetime(df['Reading Time'], format='%Y-%m-%d %H:%M:%S %Z', errors='coerce')
...all the Reading Time values are returned as "NaT"
Do I need to strip out the "+0000 UTC" first before parsing?
Thanks in advance.