Skip to content

Commit

Permalink
Remove hist_series
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladimir Turov committed Jan 24, 2022
1 parent 14874e0 commit c12c464
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions hstest/testing/plotting/pandas_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,13 +328,13 @@ def replace_plots(drawings: 'DrawingsStorage'):
from pandas.core.accessor import CachedAccessor

class CustomPlotAccessor(pandas.plotting.PlotAccessor):
def __call__(self, *args, **kwargs):
def __call__(self, *args, **kw):
from pandas.plotting._core import _get_plot_backend

plot_backend = _get_plot_backend(kwargs.pop("backend", None))
plot_backend = _get_plot_backend(kw.pop("backend", None))

x, y, kind, kwargs = self._get_call_args(
plot_backend.__name__, self._parent, args, kwargs
plot_backend.__name__, self._parent, args, kw
)

if kind not in self._all_kinds:
Expand Down Expand Up @@ -392,13 +392,13 @@ def hist(

if type(self) == pandas.DataFrame:
if column is not None:
return hist_series(self[column], **kwargs)
return hist(self[column].to_numpy(), **kwargs)
for col in self.columns:
hist_series(self[col], **kwargs)
hist(self[col].to_numpy(), **kwargs)
return

elif type(self) == pandas.Series:
return hist_series(self, **kwargs)
return hist(self.to_numpy(), **kwargs)

elif type(self) != np.ndarray:
self = np.array(self, dtype=object)
Expand Down Expand Up @@ -427,12 +427,6 @@ def hist(
)
)

def hist_series(
self,
**kwargs
):
return hist(self.to_numpy(), **kwargs)

if not PandasHandler._saved:
PandasHandler._saved = True
PandasHandler._Series_plot = pandas.Series.plot
Expand All @@ -446,7 +440,7 @@ def hist_series(

pandas.DataFrame.boxplot = boxplot
pandas.DataFrame.hist = hist
pandas.Series.hist = hist_series
pandas.Series.hist = hist

PandasHandler._replaced = True

Expand Down

0 comments on commit c12c464

Please sign in to comment.