Skip to content

Commit 0774b57

Browse files
committed
DEPR: WidePanel, LongPanel -> deprecated
1 parent 12e0705 commit 0774b57

File tree

3 files changed

+22
-5
lines changed

3 files changed

+22
-5
lines changed

doc/source/whatsnew/v0.17.0.txt

+1
Original file line numberDiff line numberDiff line change
@@ -665,6 +665,7 @@ Deprecations
665665
``DataFrame.add(other, fill_value=0)`` and ``DataFrame.mul(other, fill_value=1.)``
666666
(:issue:`10735`).
667667
- ``TimeSeries`` deprecated in favor of ``Series`` (note that this has been alias since 0.13.0), (:issue:`10890`)
668+
- ``WidePanel`` deprecated in favor of ``Panel``, ``LongPanel`` in favor of ``DataFrame`` (note these have been aliases since < 0.11.0), (:issue:`10892`)
668669

669670
.. _whatsnew_0170.prior_deprecations:
670671

pandas/core/api.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,12 @@
1212

1313
from pandas.core.series import Series, TimeSeries
1414
from pandas.core.frame import DataFrame
15-
from pandas.core.panel import Panel
15+
from pandas.core.panel import Panel, WidePanel
1616
from pandas.core.panel4d import Panel4D
1717
from pandas.core.groupby import groupby
1818
from pandas.core.reshape import (pivot_simple as pivot, get_dummies,
1919
lreshape, wide_to_long)
2020

21-
WidePanel = Panel
22-
2321
from pandas.core.indexing import IndexSlice
2422
from pandas.tseries.offsets import DateOffset
2523
from pandas.tseries.tools import to_datetime

pandas/core/panel.py

+20-2
Original file line numberDiff line numberDiff line change
@@ -1509,5 +1509,23 @@ def f(self, other, axis=0):
15091509
Panel._add_aggregate_operations()
15101510
Panel._add_numeric_operations()
15111511

1512-
WidePanel = Panel
1513-
LongPanel = DataFrame
1512+
# legacy
1513+
class WidePanel(Panel):
1514+
1515+
def __init__(self, *args, **kwargs):
1516+
1517+
# deprecation, #10892
1518+
warnings.warn("WidePanel is deprecated. Please use Panel",
1519+
FutureWarning, stacklevel=2)
1520+
1521+
super(WidePanel, self).__init__(*args, **kwargs)
1522+
1523+
class LongPanel(DataFrame):
1524+
1525+
def __init__(self, *args, **kwargs):
1526+
1527+
# deprecation, #10892
1528+
warnings.warn("LongPanel is deprecated. Please use DataFrame",
1529+
FutureWarning, stacklevel=2)
1530+
1531+
super(LongPanel, self).__init__(*args, **kwargs)

0 commit comments

Comments
 (0)