-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
Don't fail when plotting Series/DataFrame with no row #28226
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
Conversation
Can you add a test for this? |
f43abe5
to
523b3cd
Compare
Hello @randomstuff! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found: There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2019-08-30 21:04:52 UTC |
Yes, I was actually wondering how I should properly test this (and how the plot tests are done). I have added very basic tests. |
523b3cd
to
1af5d08
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Needs a release note in 1.0.0.rst.
9dbf7dc
to
4384514
Compare
When Series or DataFrames was empty (no cells) after removing columns without a suitable type (.select_dtypes), pandas was throwing a "no numeric data to plot" exception. This can happen: 1) either because there is no column with a suitable type; 2) or if there is no row. Raising an exception in the first case makes sense but we should probably avoid throwing an exception in the second case.
4384514
to
b647c39
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm @TomAugspurger
Thanks @randomstuff! |
Which exact pandas version was this added in? |
When Series or DataFrames was empty (no cells) after removing columns
without a suitable type (.select_dtypes), pandas was throwing a "no
numeric data to plot" exception.
This can happen:
either because there is no column with a suitable type;
or if there is no row.
Raising an exception in the first case makes sense but we should
probably avoid throwing an exception in the second case.
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff