diff --git a/doc/source/whatsnew/v0.17.0.txt b/doc/source/whatsnew/v0.17.0.txt index f8efa8ec23300..c2c7ca2410068 100644 --- a/doc/source/whatsnew/v0.17.0.txt +++ b/doc/source/whatsnew/v0.17.0.txt @@ -964,6 +964,7 @@ Deprecations ``DataFrame.add(other, fill_value=0)`` and ``DataFrame.mul(other, fill_value=1.)`` (:issue:`10735`). - ``TimeSeries`` deprecated in favor of ``Series`` (note that this has been alias since 0.13.0), (:issue:`10890`) +- ``SparsePanel`` deprecated and will be removed in a future version (:issue:``) - ``Series.is_time_series`` deprecated in favor of ``Series.index.is_all_dates`` (:issue:`11135`) - Legacy offsets (like ``'A@JAN'``) listed in :ref:`here ` are deprecated (note that this has been alias since 0.8.0), (:issue:`10878`) - ``WidePanel`` deprecated in favor of ``Panel``, ``LongPanel`` in favor of ``DataFrame`` (note these have been aliases since < 0.11.0), (:issue:`10892`) diff --git a/pandas/core/series.py b/pandas/core/series.py index 05a2ff6840d62..4afaae0fd25df 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -2566,7 +2566,7 @@ def last_valid_index(self): def asof(self, where): """ - Return last good (non-NaN) value in TimeSeries if value is NaN for + Return last good (non-NaN) value in Series if value is NaN for requested date. If there is no good value, NaN is returned. @@ -2624,7 +2624,7 @@ def to_timestamp(self, freq=None, how='start', copy=True): Returns ------- - ts : TimeSeries with DatetimeIndex + ts : Series with DatetimeIndex """ new_values = self._values if copy: @@ -2636,7 +2636,7 @@ def to_timestamp(self, freq=None, how='start', copy=True): def to_period(self, freq=None, copy=True): """ - Convert TimeSeries from DatetimeIndex to PeriodIndex with desired + Convert Series from DatetimeIndex to PeriodIndex with desired frequency (inferred from index if not passed) Parameters @@ -2645,7 +2645,7 @@ def to_period(self, freq=None, copy=True): Returns ------- - ts : TimeSeries with PeriodIndex + ts : Series with PeriodIndex """ new_values = self._values if copy: diff --git a/pandas/sparse/panel.py b/pandas/sparse/panel.py index 34256acfb0e60..f57339fea0a7f 100644 --- a/pandas/sparse/panel.py +++ b/pandas/sparse/panel.py @@ -5,6 +5,7 @@ # pylint: disable=E1101,E1103,W0231 +import warnings from pandas.compat import range, lrange, zip from pandas import compat import numpy as np @@ -69,6 +70,10 @@ def __init__(self, frames=None, items=None, major_axis=None, minor_axis=None, default_fill_value=np.nan, default_kind='block', copy=False): + # deprecation #11157 + warnings.warn("SparsePanel is deprecated and will be removed in a future version", + FutureWarning, stacklevel=2) + if frames is None: frames = {} diff --git a/pandas/sparse/tests/test_sparse.py b/pandas/sparse/tests/test_sparse.py index 3c42467c20838..a86942718091c 100644 --- a/pandas/sparse/tests/test_sparse.py +++ b/pandas/sparse/tests/test_sparse.py @@ -1793,6 +1793,11 @@ def test_constructor(self): "input must be a dict, a 'list' was passed"): SparsePanel(['a', 'b', 'c']) + # deprecation GH11157 + def test_deprecation(self): + with tm.assert_produces_warning(FutureWarning): + SparsePanel() + # GH 9272 def test_constructor_empty(self): sp = SparsePanel()