question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Plotly Express (px) pandas datetime with timezone converted to UTC

See original GitHub issue

Similar 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:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:12 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
emmanuellecommented, Aug 31, 2020

I also think we should fix it.

0reactions
amadeuspzscommented, Sep 21, 2020

Thanks for fixing this I was coming here to file a bug report!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found