-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Plotly express not compatible with pandas NAType/pandas.NA/pd.NA values #3253
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
Comments
Thanks for pointing that out! We'll try to get it fixed soon :) |
Note to self: will need to look at plotly.py/packages/python/plotly/_plotly_utils/utils.py Lines 168 to 178 in b34bd6d
plotly.py/packages/python/plotly/plotly/io/_json.py Lines 507 to 526 in b34bd6d
|
This simple addition worked for me when i used stolen from https://github.com/GoogleCloudPlatform/covid-19-open-data/pull/265/files :) |
#3705 partially fixed this issue. The issue is fixed when Python's import orjson # assert that orjson is available
plotly.io.json.config.default_engine = 'json'
px.scatter(pd.DataFrame([1, 2, 3, None, 5]).convert_dtypes()).to_json() # works
plotly.io.json.config.default_engine = 'auto' # or `orjson`
px.scatter(pd.DataFrame([1, 2, 3, None, 5]).convert_dtypes()).to_json() # fails |
thank you for taking a look at this @avm19 . |
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 |
Plotly express functions fall over when given dataframes containing
pd.NA
values. I think these should have the same behaviour asNone
values.Example:
The text was updated successfully, but these errors were encountered: