Skip to content

Incorrect interpretation of nullable data types #3495

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sergiykhan opened this issue Dec 2, 2021 · 5 comments
Closed

Incorrect interpretation of nullable data types #3495

sergiykhan opened this issue Dec 2, 2021 · 5 comments

Comments

@sergiykhan
Copy link

Description

Using Pandas' nullable data types (Int64 and Float64) result in an incorrect plot.

Code

import pandas as pd
import plotly.express as px
df = pd.DataFrame(
    data=[1,2,3,4,5],
    columns=['a'],
    index=pd.date_range('2021-01-01', '2021-01-05'),
    dtype='Int64',
)

px.bar(df)

Result

wrong

Expected

correct

@avm19
Copy link

avm19 commented Jan 16, 2024

Cannot reproduce in plotly '5.16.1', must've been fixed in or before this version.

@sergiykhan
Copy link
Author

I have plotly 5.18.0 installed right now, and the problem is still there.

@avm19
Copy link

avm19 commented Jan 16, 2024

I have plotly 5.18.0 installed right now, and the problem is still there.

I tried in plotly version 5.18.0, but to no avail. Maybe it depends on other packages in a tricky way.

import pandas as pd
import plotly.express as px
import plotly
df = pd.DataFrame(
    data=[1,2,3,4,5],
    columns=['a'],
    index=pd.date_range('2021-01-01', '2021-01-05'),
    dtype='Int64'
)

px.bar(df, height=300, title=plotly.__version__ + '; ' + pd.__version__)

newplot

@sergiykhan
Copy link
Author

Ah, I am still running Pandas 1.5.3 (due to bugs in 2.x related to timestamp resolution). So, I suppose some issues related to nullable types got fixed in Pandas 2.x.

1
2

@gvwilson
Copy link
Contributor

Hi - we are tidying up stale issues and PRs in Plotly's public repositories so that we can focus on things that are still important to our community. Since this one has been sitting for a while, I'm going to close it; if it is still a concern, please add a comment letting us know what recent version of our software you've checked it with so that I can reopen it and add it to our backlog. If you'd like to submit a PR, we'd be happy to prioritize a review, and if it's a request for tech support, please post in our community forum. Thank you - @gvwilson

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants