Skip to content

Commit a0ebc6e

Browse files
author
Brendan Drury
committed
Linting
1 parent 55a58bb commit a0ebc6e

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

doc/source/whatsnew/v1.4.0.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ Period
485485

486486
Plotting
487487
^^^^^^^^
488-
-
488+
- 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
489489
-
490490

491491
Groupby/resample/rolling

pandas/plotting/_matplotlib/boxplot.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ def plot_group(keys, values, ax: Axes):
390390
rc = {"figure.figsize": figsize} if figsize is not None else {}
391391
with plt.rc_context(rc):
392392
ax = plt.gca()
393-
data = data.apply(pd.to_numeric, errors='ignore')
393+
data = data.apply(pd.to_numeric, errors="ignore")
394394
data = data._get_numeric_data()
395395
if columns is None:
396396
columns = data.columns

pandas/tests/plotting/test_boxplot_method.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -542,14 +542,12 @@ def test_groupby_boxplot_subplots_false(self, col, expected_xticklabel):
542542

543543
result_xticklabel = [x.get_text() for x in axes.get_xticklabels()]
544544
assert expected_xticklabel == result_xticklabel
545-
545+
546546
def test_groupby_boxplot_object(self):
547547
# GH 43480
548548
df = self.hist_df.astype("object")
549549
grouped = df.groupby("gender")
550-
_check_plot_works(
551-
grouped.boxplot, subplots=False
552-
)
550+
_check_plot_works(grouped.boxplot, subplots=False)
553551

554552
def test_boxplot_multiindex_column(self):
555553
# GH 16748

0 commit comments

Comments
 (0)