You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
datetime
Oct 19, 2020 06:58:20 PM EDT
Oct 19, 2020 04:45:33 PM EDT
and test.py:
import pandas as pd
from datetime import datetime
input_file_path = 'test.csv'
df = pd.read_csv(input_file_path, delimiter=';')
print(df)
df['datetime'] = pd.to_datetime(df['datetime'])
print(df)
Running python test.py results in:
datetime
0 Oct 19, 2020 06:58:20 PM EDT
1 Oct 19, 2020 04:45:33 PM EDT
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dateutil/parser/_parser.py:1218: UnknownTimezoneWarning: tzname EDT identified but not understood. Pass `tzinfos` argument in order to correctly return a timezone-aware datetime. In a future version, this will raise an exception.
category=UnknownTimezoneWarning)
datetime
0 2020-10-19 18:58:20
1 2020-10-19 16:45:33
The UnknownTimezoneWarning from dateutil is what I am concerned about. I don't believe there is currently a way to pass an argument to panda's to_datetime() to avoid this. Am I missing something or does this need to be addressed?
Running with pandas v1.2.0, python v3.7.3.
The text was updated successfully, but these errors were encountered:
You can filter the warning in your code, but it is still relevant for pandas to raise this warning as we are using dateutil for the datetime parsing. The parsing behavior depends on the the version of dateutil you have installed.
If you know the timezone ahead of time, you can also preprocess your dates to strip these unsupported timezone conventions and use the tz_localize method.
The relevant issue on the pandas side is #18702. If you have any further question regarding this timezone format, please comment on that issue. So will close this one.
I have
test.csv
:and
test.py
:Running
python test.py
results in:The
UnknownTimezoneWarning
fromdateutil
is what I am concerned about. I don't believe there is currently a way to pass an argument topanda
'sto_datetime()
to avoid this. Am I missing something or does this need to be addressed?Running with
pandas
v1.2.0,python
v3.7.3.The text was updated successfully, but these errors were encountered: