'make datetime timezone aware
I have following pandas dataframe column 'datetime':
0 2022-05-10 19:44:54.993268+03:00
1 2022-05-10 19:44:54.989526+03:00
2 2022-05-10 19:44:54.985980+03:00
3 2022-05-10 19:44:54.981855+03:00
4 2022-05-10 19:44:54.978606+03:00
5 2022-05-10 19:44:54.963795+03:00
6 2022-05-10 19:44:54.900888+03:00
7 2022-05-10 19:44:54.782925+03:00
8 2022-05-10 19:44:54.724647+03:00
9 2022-05-10 19:44:54.718475+03:00
10 2022-05-10 19:44:54.712729+03:00
11 2022-05-10 19:44:54.708497+03:00
12 2022-05-10 19:44:54.689855+03:00
13 2022-05-10 00:00:01.000001+00:00
If I try to convert the
pd.to_datetime(df["datetime"])
I got following error:
ValueError: Tz-aware datetime.datetime cannot be converted to datetime64 unless utc=True
But to me it seems like all datetimes are date-time aware.
How can I avoid adding utc=True?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
