Skip to content

Commit f94b1d8

Browse files
committed
Revert "Revert "MAINT: Remove Long and WidePanel (pandas-dev#15748)" (pandas-dev#15802)" [skip ci]
This reverts commit 22f9d0d.
1 parent cfa5ea6 commit f94b1d8

File tree

6 files changed

+6
-42
lines changed

6 files changed

+6
-42
lines changed

asv_bench/benchmarks/pandas_vb_common.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,6 @@ def teardown(self, *args, **kwargs):
5151
except:
5252
pass
5353

54-
try:
55-
Panel = Panel
56-
except Exception:
57-
Panel = WidePanel
58-
5954
# didn't add to namespace until later
6055
try:
6156
from pandas.core.index import MultiIndex

doc/source/whatsnew/v0.23.0.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ Removal of prior version deprecations/changes
247247
- :func:`read_csv` has dropped the ``compact_ints`` and ``use_unsigned`` parameters (:issue:`13323`)
248248
- The ``Timestamp`` class has dropped the ``offset`` attribute in favor of ``freq`` (:issue:`13593`)
249249
- The ``Series``, ``Categorical``, and ``Index`` classes have dropped the ``reshape`` method (:issue:`13012`)
250+
- The ``LongPanel`` and ``WidePanel`` classes have been removed (:issue:`10892`)
250251

251252
.. _whatsnew_0230.performance:
252253

pandas/core/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
from pandas.core.series import Series
2323
from pandas.core.frame import DataFrame
24-
from pandas.core.panel import Panel, WidePanel
24+
from pandas.core.panel import Panel
2525
from pandas.core.panel4d import Panel4D
2626

2727
# TODO: Remove import when statsmodels updates #18264

pandas/core/panel.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1624,24 +1624,3 @@ def f(self, other, axis=0):
16241624
ops.add_special_arithmetic_methods(Panel, **ops.panel_special_funcs)
16251625
Panel._add_aggregate_operations()
16261626
Panel._add_numeric_operations()
1627-
1628-
1629-
# legacy
1630-
class WidePanel(Panel):
1631-
1632-
def __init__(self, *args, **kwargs):
1633-
# deprecation, #10892
1634-
warnings.warn("WidePanel is deprecated. Please use Panel",
1635-
FutureWarning, stacklevel=2)
1636-
1637-
super(WidePanel, self).__init__(*args, **kwargs)
1638-
1639-
1640-
class LongPanel(DataFrame):
1641-
1642-
def __init__(self, *args, **kwargs):
1643-
# deprecation, #10892
1644-
warnings.warn("LongPanel is deprecated. Please use DataFrame",
1645-
FutureWarning, stacklevel=2)
1646-
1647-
super(LongPanel, self).__init__(*args, **kwargs)

pandas/tests/io/test_pytables.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3124,9 +3124,6 @@ def _check(left, right):
31243124
wp = tm.makePanel()
31253125
self._check_roundtrip(wp.to_frame(), _check)
31263126

3127-
def test_longpanel(self):
3128-
pass
3129-
31303127
def test_overwrite_node(self):
31313128

31323129
with ensure_clean_store(self.path) as store:

pandas/tests/test_panel.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,6 @@ def wrapper(x):
181181

182182
class SafeForSparse(object):
183183

184-
@classmethod
185-
def assert_panel_equal(cls, x, y):
186-
assert_panel_equal(x, y)
187-
188184
def test_get_axis(self):
189185
assert (self.panel._get_axis(0) is self.panel.items)
190186
assert (self.panel._get_axis(1) is self.panel.major_axis)
@@ -903,10 +899,6 @@ def test_set_value(self):
903899
class TestPanel(PanelTests, CheckIndexing, SafeForLongAndSparse,
904900
SafeForSparse):
905901

906-
@classmethod
907-
def assert_panel_equal(cls, x, y):
908-
assert_panel_equal(x, y)
909-
910902
def setup_method(self, method):
911903
self.panel = make_test_panel()
912904
self.panel.major_axis.name = None
@@ -2152,8 +2144,8 @@ def test_multiindex_get(self):
21522144
assert (f1.items == [1, 2]).all()
21532145
assert (f2.items == [1, 2]).all()
21542146

2155-
ind = MultiIndex.from_tuples([('a', 1), ('a', 2), ('b', 1)],
2156-
names=['first', 'second'])
2147+
MultiIndex.from_tuples([('a', 1), ('a', 2), ('b', 1)],
2148+
names=['first', 'second'])
21572149

21582150
def test_multiindex_blocks(self):
21592151
with catch_warnings(record=True):
@@ -2458,9 +2450,9 @@ def test_sort_values(self):
24582450
pytest.raises(NotImplementedError, self.panel.sort_values, 'ItemA')
24592451

24602452

2461-
class TestLongPanel(object):
2453+
class TestPanelFrame(object):
24622454
"""
2463-
LongPanel no longer exists, but...
2455+
Check that conversions to and from Panel to DataFrame work.
24642456
"""
24652457

24662458
def setup_method(self, method):

0 commit comments

Comments
 (0)