Skip to content

[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

Merged
merged 8 commits into from
Nov 14, 2021

Conversation

brendandrury
Copy link
Contributor

@brendandrury brendandrury commented Oct 12, 2021

Copy link
Contributor

@jreback jreback left a 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.

@@ -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
Copy link
Contributor

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")
Copy link
Contributor

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.

@jreback jreback added the Visualization plotting label Oct 21, 2021
@jreback jreback added this to the 1.4 milestone Nov 14, 2021
@jreback jreback merged commit 4d69450 into pandas-dev:master Nov 14, 2021
@jreback
Copy link
Contributor

jreback commented Nov 14, 2021

thanks @brendandrury

nickleus27 pushed a commit to nickleus27/pandas that referenced this pull request Nov 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: DataFrameGroupBy.boxplot with subplots=False fails for object columns
2 participants