Skip to content

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

Closed
@m0wer

Description

@m0wer

Similar to what happened in #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()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions