From 8cf5557e83fe9c0b828ccd37b42a9a63bb8898f7 Mon Sep 17 00:00:00 2001 From: gfyoung Date: Fri, 19 Aug 2016 01:59:50 -0400 Subject: [PATCH] CLN: Drop lags parameter from Panel.shift --- doc/source/whatsnew/v0.19.0.txt | 1 + pandas/core/panel.py | 3 +-- pandas/tests/test_panel.py | 14 -------------- 3 files changed, 2 insertions(+), 16 deletions(-) diff --git a/doc/source/whatsnew/v0.19.0.txt b/doc/source/whatsnew/v0.19.0.txt index c7f0beb439596..cc3cc631b9575 100644 --- a/doc/source/whatsnew/v0.19.0.txt +++ b/doc/source/whatsnew/v0.19.0.txt @@ -891,6 +891,7 @@ Removal of prior version deprecations/changes - ``pd.Categorical`` has dropped setting of the ``ordered`` attribute directly in favor of the ``set_ordered`` method (:issue:`13671`) - ``pd.Categorical`` has dropped the ``levels`` attribute in favour of ``categories`` (:issue:`8376`) - ``DataFrame.to_sql()`` has dropped the ``mysql`` option for the ``flavor`` parameter (:issue:`13611`) +- ``Panel.shift()`` has dropped the ``lags`` parameter in favour of ``periods`` (:issue:`14041`) - ``pd.Index`` has dropped the ``diff`` method in favour of ``difference`` (:issue:`13669`) - ``Series.to_csv`` has dropped the ``nanRep`` parameter in favor of ``na_rep`` (:issue:`13804`) diff --git a/pandas/core/panel.py b/pandas/core/panel.py index b8cd9b90e7989..b2082ce29545e 100644 --- a/pandas/core/panel.py +++ b/pandas/core/panel.py @@ -35,7 +35,7 @@ from pandas.core.ops import _op_descriptions from pandas.core.series import Series from pandas.tools.util import cartesian_product -from pandas.util.decorators import (deprecate, Appender, deprecate_kwarg) +from pandas.util.decorators import (deprecate, Appender) _shared_doc_kwargs = dict( axes='items, major_axis, minor_axis', @@ -1234,7 +1234,6 @@ def count(self, axis='major'): return self._wrap_result(result, axis) - @deprecate_kwarg(old_arg_name='lags', new_arg_name='periods') def shift(self, periods=1, freq=None, axis='major'): """ Shift index by desired number of periods with an optional time freq. diff --git a/pandas/tests/test_panel.py b/pandas/tests/test_panel.py index a93f2ae5651b4..1f9ca4635b585 100644 --- a/pandas/tests/test_panel.py +++ b/pandas/tests/test_panel.py @@ -881,20 +881,6 @@ def setUp(self): self.panel.minor_axis.name = None self.panel.items.name = None - def test_panel_warnings(self): - with tm.assert_produces_warning(FutureWarning): - shifted1 = self.panel.shift(lags=1) - - with tm.assert_produces_warning(False): - shifted2 = self.panel.shift(periods=1) - - tm.assert_panel_equal(shifted1, shifted2) - - with tm.assert_produces_warning(False): - shifted3 = self.panel.shift() - - tm.assert_panel_equal(shifted1, shifted3) - def test_constructor(self): # with BlockManager wp = Panel(self.panel._data)