diff --git a/pandas/core/arrays/sparse/accessor.py b/pandas/core/arrays/sparse/accessor.py index 57fd6d284af31..595af6dc08733 100644 --- a/pandas/core/arrays/sparse/accessor.py +++ b/pandas/core/arrays/sparse/accessor.py @@ -308,8 +308,7 @@ def to_coo(self): @property def density(self) -> float: """ - Ratio of non-sparse points to total (dense) data points - represented in the DataFrame. + Ratio of non-sparse points to total (dense) data points. """ return np.mean([column.array.density for _, column in self._parent.items()]) diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 23611055d6f01..d7043a8cda7b2 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -814,8 +814,10 @@ def to_string( @property def style(self): """ - Property returning a Styler object containing methods for - building a styled HTML representation fo the DataFrame. + Returns a Styler object. + + Contains methods for building a styled HTML representation of the DataFrame. + a styled HTML representation fo the DataFrame. See Also -------- @@ -8207,6 +8209,8 @@ def to_timestamp(self, freq=None, how="start", axis=0, copy=True): def to_period(self, freq=None, axis=0, copy=True): """ + Convert DataFrame from DatetimeIndex to PeriodIndex. + Convert DataFrame from DatetimeIndex to PeriodIndex with desired frequency (inferred from index if not passed). diff --git a/pandas/core/generic.py b/pandas/core/generic.py index fe0923f096493..81742b5337e47 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -5766,8 +5766,7 @@ def ftypes(self): def as_blocks(self, copy=True): """ - Convert the frame to a dict of dtype -> Constructor Types that each has - a homogeneous dtype. + Convert the frame to a dict of dtype -> Constructor Types. .. deprecated:: 0.21.0 @@ -9428,9 +9427,10 @@ def shift(self, periods=1, freq=None, axis=0, fill_value=None): def slice_shift(self, periods=1, axis=0): """ - Equivalent to `shift` without copying data. The shifted data will - not include the dropped periods and the shifted axis will be smaller - than the original. + Equivalent to `shift` without copying data. + + The shifted data will not include the dropped periods and the + shifted axis will be smaller than the original. Parameters ---------- @@ -10739,10 +10739,11 @@ def nanptp(values, axis=0, skipna=True): name, name2, axis_descr, - """Return the difference between the maximum value and the + """Return the difference between the min and max value. + \n.. deprecated:: 0.24.0 Use numpy.ptp instead + \nReturn the difference between the maximum value and the minimum value in the object. This is the equivalent of the - ``numpy.ndarray`` method ``ptp``.\n\n.. deprecated:: 0.24.0 - Use numpy.ptp instead""", + ``numpy.ndarray`` method ``ptp``.""", nanptp, ) diff --git a/pandas/core/indexing.py b/pandas/core/indexing.py index 45cb037600fd7..44c786f003369 100755 --- a/pandas/core/indexing.py +++ b/pandas/core/indexing.py @@ -1291,8 +1291,7 @@ def _get_slice_axis(self, slice_obj: slice, axis: int): class _IXIndexer(_NDFrameIndexer): """ - A primarily label-location based indexer, with integer position - fallback. + A primarily label-location based indexer, with integer position fallback. Warning: Starting in 0.20.0, the .ix indexer is deprecated, in favor of the more strict .iloc and .loc indexers. diff --git a/pandas/plotting/_core.py b/pandas/plotting/_core.py index 127fdffafcf36..c11d94c381d6d 100644 --- a/pandas/plotting/_core.py +++ b/pandas/plotting/_core.py @@ -496,7 +496,9 @@ def boxplot_frame_groupby( class PlotAccessor(PandasObject): """ - Make plots of Series or DataFrame using the backend specified by the + Make plots of Series or DataFrame. + + Uses the backend specified by the option ``plotting.backend``. By default, matplotlib is used. Parameters