[BUG] Plotly Express (px) pandas datetime with timezone converted to UTC
See original GitHub issueSimilar to what happened in https://github.com/plotly/plotly.py/issues/209 Plotly Express converts the Pandas datetime object to UTC instead of respecting its timezone. If the datetime is a string or is converted to pydatetime
it works as expected. A reproducible example is available at https://gist.github.com/m0wer/74d5a8901b9499795d13992d29cc2f0c.
A workaround (shown in the example) is to convert the datetime column of the Pandas DataFrame to pydatetime
with:
df['date'].dt.to_pydatetime()
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:12 (10 by maintainers)
Top Results From Across the Web
How to convert UTC to client time zone in plotly - Stack Overflow
Show activity on this post. I am combining data from different sources in my graph and some is in UTC format (e.g., 2021-01-06T06:00:00Z...
Read more >Plotly uses my local timezone when having dates as data
Hi, If I understand correctly, Plotly uses the local timezone of the machine by default to avoid DST problem, right?
Read more >How can I convince DateTime object (initialized with pytz ...
Coding example for the question How can I convince DateTime object (initialized with pytz timezone) to get me a timezone code recognized by...
Read more >Releases — HoloViews v1.15.3
Ensured pandas does not convert times to UTC (#4711). Removed all use of cyordereddict (#4620). Testing infrastructure moved to GH Actions (#4592). Bug...
Read more >How To Convert Epoch To Date In Plotly - ADocLib
Express is a regular part of the Plotly python package so the easiest is to ... a bunch of gymnastics to convert Date...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I also think we should fix it.
Thanks for fixing this I was coming here to file a bug report!