-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
axes.bar fails when x is int-indexed pandas.Series #15162
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
This came in with #12903. Worth noting that |
Sorry for the bug. I guess we could just put the old messy code back in, but it'd be nice if someone who understood pandas data types and inheritance figured out the proper solution. Obviously if you remove the index argument this works, or changing the index to zero-indexing. Is |
Apparently |
Yeah but why doesn’t df.x[0] return the first element? |
For the same reason |
OK, well, this comes back to the units parsing. We can't just The obvious stopgap is to just put in the |
Is there any alternative to finding the |
I think I have a solution that squares all the constraints, but avoids using a library-specific method like |
It is better to think of data frames as "dicts of Series with a bunch of helper methods" and Series as "ordered dicts of values with an optional index based lookup and helper methods". I have lobbied Jeff Reback to get the behavior of |
Bug report
Bug summary
The following codes fail in matplotlib 3.1.1, while work properly in 3.0.3
case 1
Code for reproduction
Actual outcome
Expected outcome

Outcome in 3.0.3:
case 2
Code for reproduction
Actual outcome

Expected outcome

Outcome in 3.0.3:
Matplotlib version
print(matplotlib.get_backend())
): MacOSXCause of the bug
I guess x0 is expected to be a scalar after this line, However when x0 is an int-indexed (and 0 is not in its indices) pandas.Series, it is continued to be pandas.Series and causes chained disorders to end in the error above.
To evidence, they worked properly when rewritten as (ugly!):
The text was updated successfully, but these errors were encountered: