You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Oddly enough, this seems to be an issue with the way px.bar() determines orientation! It seems to incorrectly decide that orientation should be "v" for these inputs, which causes the interpretations of x and y to be reversed. If you look very very closely, or zoom in, you can see very thin horizontal bars located at 0, 6, 696, and 31335 along the y-axis.
Forcing orientation="v" results in the expected plot:
Looks like the bug traces to the _is_continuous() function in plotly/express/_core.py, which evaluates to False in the case of Rain_count, causing Plotly Express to decide that Rain_count is the categorical array and should be treated as the bar labels.
It seems the root cause is that dtype.kind for the Rain_count column is u, which is not one of "ifc".
Plausibly we should just change "in "ifc" to in "ifcu" — @MarcoGorelli do you see any issue with that? Looks like that does resolve the issue.
Activity
emilykl commentedon Sep 1, 2026
Oddly enough, this seems to be an issue with the way
px.bar()determinesorientation! It seems to incorrectly decide thatorientationshould be"v"for these inputs, which causes the interpretations of x and y to be reversed. If you look very very closely, or zoom in, you can see very thin horizontal bars located at 0, 6, 696, and 31335 along the y-axis.Forcing

orientation="v"results in the expected plot:Looks like the bug traces to the
_is_continuous()function inplotly/express/_core.py, which evaluates toFalsein the case ofRain_count, causing Plotly Express to decide thatRain_countis the categorical array and should be treated as the bar labels.It seems the root cause is that
dtype.kindfor theRain_countcolumn isu, which is not one of"ifc".Plausibly we should just change
"in "ifc"toin "ifcu"— @MarcoGorelli do you see any issue with that? Looks like that does resolve the issue.Numpy
dtype.kindvalues: https://numpy.org/doc/stable/reference/generated/numpy.dtype.kind.htmlemilykl commentedon Sep 1, 2026
I think this has the same root cause as #4344
fix px treating unsigned int columns as categorical
MarcoGorelli commentedon Sep 19, 2026
Sorry for the delay, but yes, that looks fine, thanks 🙏