Skip to content

Commit c941694

Browse files
committed
CLN: Remove the Panel4D and PanelND classes
Deprecated back in v0.19.0 xref pandas-devgh-13147
1 parent ab000a9 commit c941694

17 files changed

+23
-1616
lines changed

doc/source/whatsnew/v0.23.0.txt

+1
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ Removal of prior version deprecations/changes
249249
- The ``Series``, ``Categorical``, and ``Index`` classes have dropped the ``reshape`` method (:issue:`13012`)
250250
- ``pandas.tseries.frequencies.get_standard_freq`` has been removed in favor of ``pandas.tseries.frequencies.to_offset(freq).rule_code`` (:issue:`13874`)
251251
- The ``freqstr`` keyword has been removed from ``pandas.tseries.frequencies.to_offset`` in favor of ``freq`` (:issue:`13874`)
252+
- The ``Panel4D`` and ``PanelND`` classes have been removed (:issue:`13776`)
252253

253254
.. _whatsnew_0230.performance:
254255

pandas/core/api.py

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
from pandas.core.series import Series
2323
from pandas.core.frame import DataFrame
2424
from pandas.core.panel import Panel, WidePanel
25-
from pandas.core.panel4d import Panel4D
2625

2726
# TODO: Remove import when statsmodels updates #18264
2827
from pandas.core.reshape.reshape import get_dummies

pandas/core/dtypes/generic.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def _check(cls, inst):
4343

4444
ABCSeries = create_pandas_abc_type("ABCSeries", "_typ", ("series", ))
4545
ABCDataFrame = create_pandas_abc_type("ABCDataFrame", "_typ", ("dataframe", ))
46-
ABCPanel = create_pandas_abc_type("ABCPanel", "_typ", ("panel", "panel4d"))
46+
ABCPanel = create_pandas_abc_type("ABCPanel", "_typ", ("panel",))
4747
ABCSparseSeries = create_pandas_abc_type("ABCSparseSeries", "_subtyp",
4848
('sparse_series',
4949
'sparse_time_series'))

pandas/core/panel4d.py

-99
This file was deleted.

pandas/core/panelnd.py

-132
This file was deleted.

pandas/io/pytables.py

+3-14
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
from pandas.core.dtypes.missing import array_equivalent
2525

2626
import numpy as np
27-
from pandas import (Series, DataFrame, Panel, Panel4D, Index,
27+
from pandas import (Series, DataFrame, Panel, Index,
2828
MultiIndex, Int64Index, isna, concat, to_datetime,
2929
SparseSeries, SparseDataFrame, PeriodIndex,
3030
DatetimeIndex, TimedeltaIndex)
@@ -180,7 +180,6 @@ class DuplicateWarning(Warning):
180180
DataFrame: u('frame'),
181181
SparseDataFrame: u('sparse_frame'),
182182
Panel: u('wide'),
183-
Panel4D: u('ndim'),
184183
}
185184

186185
# storer class map
@@ -203,7 +202,6 @@ class DuplicateWarning(Warning):
203202
u('appendable_frame'): 'AppendableFrameTable',
204203
u('appendable_multiframe'): 'AppendableMultiFrameTable',
205204
u('appendable_panel'): 'AppendablePanelTable',
206-
u('appendable_ndim'): 'AppendableNDimTable',
207205
u('worm'): 'WORMTable',
208206
u('legacy_frame'): 'LegacyFrameTable',
209207
u('legacy_panel'): 'LegacyPanelTable',
@@ -212,8 +210,7 @@ class DuplicateWarning(Warning):
212210
# axes map
213211
_AXES_MAP = {
214212
DataFrame: [0],
215-
Panel: [1, 2],
216-
Panel4D: [1, 2, 3],
213+
Panel: [1, 2]
217214
}
218215

219216
# register our configuration options
@@ -924,7 +921,7 @@ def append(self, key, value, format=None, append=True, columns=None,
924921
Parameters
925922
----------
926923
key : object
927-
value : {Series, DataFrame, Panel, Panel4D}
924+
value : {Series, DataFrame, Panel}
928925
format: 'table' is the default
929926
table(t) : table format
930927
Write as a PyTables Table structure which may perform
@@ -4346,14 +4343,6 @@ def is_transposed(self):
43464343
return self.data_orientation != tuple(range(self.ndim))
43474344

43484345

4349-
class AppendableNDimTable(AppendablePanelTable):
4350-
4351-
""" suppor the new appendable table formats """
4352-
table_type = u('appendable_ndim')
4353-
ndim = 4
4354-
obj_type = Panel4D
4355-
4356-
43574346
def _reindex_axis(obj, axis, labels, other=None):
43584347
ax = obj._get_axis(axis)
43594348
labels = _ensure_index(labels)

pandas/tests/api/test_api.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ class TestPDApi(Base):
5151
'TimedeltaIndex', 'Timestamp', 'Interval', 'IntervalIndex']
5252

5353
# these are already deprecated; awaiting removal
54-
deprecated_classes = ['WidePanel', 'Panel4D', 'TimeGrouper',
55-
'Expr', 'Term']
54+
deprecated_classes = ['WidePanel', 'TimeGrouper', 'Expr', 'Term']
5655

5756
# these should be deprecated in the future
5857
deprecated_classes_in_future = ['Panel']

pandas/tests/dtypes/test_missing.py

-7
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,6 @@ def test_isna_isnull(self, isna_f):
9999
expected = p.apply(isna_f)
100100
tm.assert_panel_equal(result, expected)
101101

102-
# panel 4d
103-
with catch_warnings(record=True):
104-
for p in [tm.makePanel4D(), tm.add_nans_panel4d(tm.makePanel4D())]:
105-
result = isna_f(p)
106-
expected = p.apply(isna_f)
107-
tm.assert_panel4d_equal(result, expected)
108-
109102
def test_isna_lists(self):
110103
result = isna([[False]])
111104
exp = np.array([[False]])

pandas/tests/frame/test_query_eval.py

-6
Original file line numberDiff line numberDiff line change
@@ -366,12 +366,6 @@ def test_raise_on_panel_with_multiindex(self, parser, engine):
366366
with pytest.raises(NotImplementedError):
367367
pd.eval('p + 1', parser=parser, engine=engine)
368368

369-
def test_raise_on_panel4d_with_multiindex(self, parser, engine):
370-
p4d = tm.makePanel4D(7)
371-
p4d.items = tm.makeCustomIndex(len(p4d.items), nlevels=2)
372-
with pytest.raises(NotImplementedError):
373-
pd.eval('p4d + 1', parser=parser, engine=engine)
374-
375369

376370
@td.skip_if_no_ne
377371
class TestDataFrameQueryNumExprPandas(object):

0 commit comments

Comments
 (0)