From 0774b57ac1e0301b77984734afee30a772195dca Mon Sep 17 00:00:00 2001 From: Jeff Reback Date: Sun, 23 Aug 2015 09:41:06 -0400 Subject: [PATCH] DEPR: WidePanel, LongPanel -> deprecated --- doc/source/whatsnew/v0.17.0.txt | 1 + pandas/core/api.py | 4 +--- pandas/core/panel.py | 22 ++++++++++++++++++++-- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/doc/source/whatsnew/v0.17.0.txt b/doc/source/whatsnew/v0.17.0.txt index d6a4eb5b41b4e..fdbb5771aff3f 100644 --- a/doc/source/whatsnew/v0.17.0.txt +++ b/doc/source/whatsnew/v0.17.0.txt @@ -665,6 +665,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`) +- ``WidePanel`` deprecated in favor of ``Panel``, ``LongPanel`` in favor of ``DataFrame`` (note these have been aliases since < 0.11.0), (:issue:`10892`) .. _whatsnew_0170.prior_deprecations: diff --git a/pandas/core/api.py b/pandas/core/api.py index 686e55478e41c..e2ac57e37cba6 100644 --- a/pandas/core/api.py +++ b/pandas/core/api.py @@ -12,14 +12,12 @@ from pandas.core.series import Series, TimeSeries from pandas.core.frame import DataFrame -from pandas.core.panel import Panel +from pandas.core.panel import Panel, WidePanel from pandas.core.panel4d import Panel4D from pandas.core.groupby import groupby from pandas.core.reshape import (pivot_simple as pivot, get_dummies, lreshape, wide_to_long) -WidePanel = Panel - from pandas.core.indexing import IndexSlice from pandas.tseries.offsets import DateOffset from pandas.tseries.tools import to_datetime diff --git a/pandas/core/panel.py b/pandas/core/panel.py index 8d0f1a8748d3a..d45422ecfa81d 100644 --- a/pandas/core/panel.py +++ b/pandas/core/panel.py @@ -1509,5 +1509,23 @@ def f(self, other, axis=0): Panel._add_aggregate_operations() Panel._add_numeric_operations() -WidePanel = Panel -LongPanel = DataFrame +# legacy +class WidePanel(Panel): + + def __init__(self, *args, **kwargs): + + # deprecation, #10892 + warnings.warn("WidePanel is deprecated. Please use Panel", + FutureWarning, stacklevel=2) + + super(WidePanel, self).__init__(*args, **kwargs) + +class LongPanel(DataFrame): + + def __init__(self, *args, **kwargs): + + # deprecation, #10892 + warnings.warn("LongPanel is deprecated. Please use DataFrame", + FutureWarning, stacklevel=2) + + super(LongPanel, self).__init__(*args, **kwargs)