-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
[BUG] Fix DataFrameGroupBy.boxplot with subplots=False fails for object columns #44003
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
brendandrury
commented
Oct 12, 2021
•
edited
Loading
edited
- closes BUG: DataFrameGroupBy.boxplot with subplots=False fails for object columns #43480
- tests added / passed
- Ensure all linting tests pass, see here for how to run them
- whatsnew entry
This converts numeric objects to numeric types before discarding non-numeric types.
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.
questions even if this is a valid bug in the first place. pls comment on the issue.
doc/source/whatsnew/v1.4.0.rst
Outdated
@@ -542,7 +542,7 @@ Period | |||
|
|||
Plotting | |||
^^^^^^^^ | |||
- | |||
- Fixed bug in :meth:`boxplot._grouped_plot_by_column` where trying to plot data of dtype ``object`` caused plotting to fail even if some data was numeric |
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.
the note should be user facing, not referencing an internal function. Include the issue number (see other notes for how to do this)
@@ -390,6 +390,7 @@ def plot_group(keys, values, ax: Axes): | |||
rc = {"figure.figsize": figsize} if figsize is not None else {} | |||
with plt.rc_context(rc): | |||
ax = plt.gca() | |||
data = data.apply(pd.to_numeric, errors="ignore") |
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.
umm why do you think we should do this? if its an object column its not numeric. sure it can be coerced but that's up to the user.
thanks @brendandrury |