Skip to content

Commit 062f6f1

Browse files
jbrockmendeljreback
authored andcommitted
Remove boxplot from _dataframe_apply_whitelist (#17381)
1 parent 764cf2a commit 062f6f1

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

pandas/core/groupby.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@
6363
import pandas.core.common as com
6464
from pandas.core.config import option_context
6565

66+
from pandas.plotting._core import boxplot_frame_groupby
67+
6668
from pandas._libs import lib, groupby as libgroupby, Timestamp, NaT, iNaT
6769
from pandas._libs.lib import count_level_2d
6870

@@ -168,8 +170,9 @@
168170
{'nlargest', 'nsmallest'}) -
169171
{'boxplot'}) | frozenset(['dtype', 'unique'])
170172

171-
_dataframe_apply_whitelist = (_common_apply_whitelist |
172-
frozenset(['dtypes', 'corrwith']))
173+
_dataframe_apply_whitelist = ((_common_apply_whitelist |
174+
frozenset(['dtypes', 'corrwith'])) -
175+
{'boxplot'})
173176

174177
_cython_transforms = frozenset(['cumprod', 'cumsum', 'shift',
175178
'cummin', 'cummax'])
@@ -4280,9 +4283,7 @@ def groupby_series(obj, col=None):
42804283
results.index = _default_index(len(results))
42814284
return results
42824285

4283-
4284-
from pandas.plotting._core import boxplot_frame_groupby # noqa
4285-
DataFrameGroupBy.boxplot = boxplot_frame_groupby
4286+
boxplot = boxplot_frame_groupby
42864287

42874288

42884289
class PanelGroupBy(NDFrameGroupBy):

pandas/tests/groupby/test_whitelist.py

-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
'pct_change',
4343
'skew',
4444
'plot',
45-
'boxplot',
4645
'hist',
4746
'median',
4847
'dtypes',

0 commit comments

Comments
 (0)