Skip to content

Commit 411b94d

Browse files
committed
MAINT: Remove Long and WidePanel
Deprecated since 0.17.0. xref pandas-devgh-10892
1 parent b1e29db commit 411b94d

File tree

9 files changed

+5
-46
lines changed

9 files changed

+5
-46
lines changed

asv_bench/benchmarks/pandas_vb_common.py

-5
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,6 @@
2525
except:
2626
pass
2727

28-
try:
29-
Panel = Panel
30-
except Exception:
31-
Panel = WidePanel
32-
3328
# didn't add to namespace until later
3429
try:
3530
from pandas.core.index import MultiIndex

bench/bench_join_panel.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ def reindex_on_axis(panels, axis, axis_reindex):
4545
return p
4646

4747

48-
# does the job but inefficient (better to handle like you read a table in
49-
# pytables...e.g create a LongPanel then convert to Wide)
48+
# Does the job but inefficient. It is better to handle
49+
# this like you read a table in pytables.
5050
def create_panels_join(cls, panels):
5151
""" given an array of panels's, create a single panel """
5252
panels = [a for a in panels if a is not None]

doc/source/whatsnew/v0.20.0.txt

+1
Original file line numberDiff line numberDiff line change
@@ -772,6 +772,7 @@ Removal of prior version deprecations/changes
772772
- The ``Categorical`` constructor has dropped the ``name`` parameter (:issue:`10632`)
773773
- The ``take_last`` parameter has been dropped from ``duplicated()``, ``drop_duplicates()``, ``nlargest()``, and ``nsmallest()`` methods (:issue:`10236`, :issue:`10792`, :issue:`10920`)
774774
- ``Series``, ``Index``, and ``DataFrame`` have dropped the ``sort`` and ``order`` methods (:issue:`10726`)
775+
- The ``LongPanel`` and ``WidePanel`` classes have been removed (:issue:`10892`)
775776

776777
.. _whatsnew_0200.performance:
777778

pandas/core/api.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
from pandas.core.series import Series
1717
from pandas.core.frame import DataFrame
18-
from pandas.core.panel import Panel, WidePanel
18+
from pandas.core.panel import Panel
1919
from pandas.core.panel4d import Panel4D
2020
from pandas.core.reshape import (pivot_simple as pivot, get_dummies,
2121
lreshape, wide_to_long)

pandas/core/panel.py

-21
Original file line numberDiff line numberDiff line change
@@ -1556,24 +1556,3 @@ def f(self, other, axis=0):
15561556
ops.add_special_arithmetic_methods(Panel, **ops.panel_special_funcs)
15571557
Panel._add_aggregate_operations()
15581558
Panel._add_numeric_operations()
1559-
1560-
1561-
# legacy
1562-
class WidePanel(Panel):
1563-
1564-
def __init__(self, *args, **kwargs):
1565-
# deprecation, #10892
1566-
warnings.warn("WidePanel is deprecated. Please use Panel",
1567-
FutureWarning, stacklevel=2)
1568-
1569-
super(WidePanel, self).__init__(*args, **kwargs)
1570-
1571-
1572-
class LongPanel(DataFrame):
1573-
1574-
def __init__(self, *args, **kwargs):
1575-
# deprecation, #10892
1576-
warnings.warn("LongPanel is deprecated. Please use DataFrame",
1577-
FutureWarning, stacklevel=2)
1578-
1579-
super(LongPanel, self).__init__(*args, **kwargs)

pandas/tests/api/test_api.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ class TestPDApi(Base, tm.TestCase):
5454
'TimedeltaIndex', 'Timestamp']
5555

5656
# these are already deprecated; awaiting removal
57-
deprecated_classes = ['WidePanel', 'Panel4D',
58-
'SparseList', 'Expr', 'Term']
57+
deprecated_classes = ['Panel4D', 'SparseList', 'Expr', 'Term']
5958

6059
# these should be deprecated in the future
6160
deprecated_classes_in_future = ['Panel']

pandas/tests/io/test_pytables.py

-3
Original file line numberDiff line numberDiff line change
@@ -3017,9 +3017,6 @@ def _check(left, right):
30173017
# empty
30183018
# self._check_roundtrip(wp.to_frame()[:0], _check)
30193019

3020-
def test_longpanel(self):
3021-
pass
3022-
30233020
def test_overwrite_node(self):
30243021

30253022
with ensure_clean_store(self.path) as store:

pandas/tests/test_panel.py

-7
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,6 @@ def wrapper(x):
178178

179179
class SafeForSparse(object):
180180

181-
@classmethod
182-
def assert_panel_equal(cls, x, y):
183-
assert_panel_equal(x, y)
184-
185181
def test_get_axis(self):
186182
assert (self.panel._get_axis(0) is self.panel.items)
187183
assert (self.panel._get_axis(1) is self.panel.major_axis)
@@ -2276,9 +2272,6 @@ class TestLongPanel(tm.TestCase):
22762272
"""
22772273

22782274
def setUp(self):
2279-
import warnings
2280-
warnings.filterwarnings(action='ignore', category=FutureWarning)
2281-
22822275
panel = tm.makePanel()
22832276
tm.add_nans(panel)
22842277

vb_suite/pandas_vb_common.py

-5
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@
1818
except:
1919
import pandas._libs.lib as lib
2020

21-
try:
22-
Panel = WidePanel
23-
except Exception:
24-
pass
25-
2621
# didn't add to namespace until later
2722
try:
2823
from pandas.core.index import MultiIndex

0 commit comments

Comments
 (0)