Skip to content
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

Unified PlotAccessor for DataFrame and Series #1662

Merged
merged 16 commits into from
Aug 12, 2020
8 changes: 4 additions & 4 deletions databricks/koalas/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
from databricks.koalas.missing.frame import _MissingPandasLikeDataFrame
from databricks.koalas.ml import corr
from databricks.koalas.typedef import infer_return_type, as_spark_type, DataFrameType, SeriesType
from databricks.koalas.plot import KoalasFramePlotMethods
from databricks.koalas.plot import KoalasPlotAccessor

# These regular expression patterns are complied and defined here to avoid to compile the same
# pattern every time it is used in _repr_ and _repr_html_ in DataFrame.
Expand Down Expand Up @@ -806,7 +806,7 @@ def add(self, other):
return self + other

# create accessor for plot
plot = CachedAccessor("plot", KoalasFramePlotMethods)
plot = CachedAccessor("plot", KoalasPlotAccessor)

# create accessor for Spark related methods.
spark = CachedAccessor("spark", SparkFrameMethods)
Expand All @@ -817,12 +817,12 @@ def add(self, other):
def hist(self, bins=10, **kwds):
return self.plot.hist(bins, **kwds)

hist.__doc__ = KoalasFramePlotMethods.hist.__doc__
hist.__doc__ = KoalasPlotAccessor.hist.__doc__

def kde(self, bw_method=None, ind=None, **kwds):
return self.plot.kde(bw_method, ind, **kwds)

kde.__doc__ = KoalasFramePlotMethods.kde.__doc__
kde.__doc__ = KoalasPlotAccessor.kde.__doc__

add.__doc__ = _flex_doc_FRAME.format(
desc="Addition", op_name="+", equiv="dataframe + other", reverse="radd"
Expand Down
Loading