@@ -5746,12 +5746,21 @@ def isin(self, values):
57465746 values ).reshape (self .shape ), self .index ,
57475747 self .columns )
57485748
5749+ # ----------------------------------------------------------------------
5750+ # Add plotting methods to DataFrame
5751+ plot = base .AccessorProperty (gfx .FramePlotMethods , gfx .FramePlotMethods )
5752+ hist = gfx .hist_frame
5753+ boxplot = gfx .boxplot_frame
5754+
57495755
57505756DataFrame ._setup_axes (['index' , 'columns' ], info_axis = 1 , stat_axis = 0 ,
57515757 axes_are_reversed = True , aliases = {'rows' : 0 })
57525758DataFrame ._add_numeric_operations ()
57535759DataFrame ._add_series_or_dataframe_operations ()
57545760
5761+ ops .add_flex_arithmetic_methods (DataFrame , ** ops .frame_flex_funcs )
5762+ ops .add_special_arithmetic_methods (DataFrame , ** ops .frame_special_funcs )
5763+
57555764_EMPTY_SERIES = Series ([])
57565765
57575766
@@ -6097,28 +6106,3 @@ def _from_nested_dict(data):
60976106
60986107def _put_str (s , space ):
60996108 return ('%s' % s )[:space ].ljust (space )
6100-
6101-
6102- # ----------------------------------------------------------------------
6103- # Add plotting methods to DataFrame
6104- DataFrame .plot = base .AccessorProperty (gfx .FramePlotMethods ,
6105- gfx .FramePlotMethods )
6106- DataFrame .hist = gfx .hist_frame
6107-
6108-
6109- @Appender (_shared_docs ['boxplot' ] % _shared_doc_kwargs )
6110- def boxplot (self , column = None , by = None , ax = None , fontsize = None , rot = 0 ,
6111- grid = True , figsize = None , layout = None , return_type = None , ** kwds ):
6112- from pandas .plotting ._core import boxplot
6113- import matplotlib .pyplot as plt
6114- ax = boxplot (self , column = column , by = by , ax = ax , fontsize = fontsize ,
6115- grid = grid , rot = rot , figsize = figsize , layout = layout ,
6116- return_type = return_type , ** kwds )
6117- plt .draw_if_interactive ()
6118- return ax
6119-
6120-
6121- DataFrame .boxplot = boxplot
6122-
6123- ops .add_flex_arithmetic_methods (DataFrame , ** ops .frame_flex_funcs )
6124- ops .add_special_arithmetic_methods (DataFrame , ** ops .frame_special_funcs )
0 commit comments