Skip to content

Commit

Permalink
CLN: Remove the Panel4D and PanelND classes
Browse files Browse the repository at this point in the history
Deprecated back in v0.19.0

xref pandas-devgh-13147
  • Loading branch information
gfyoung committed Jan 3, 2018
1 parent ab000a9 commit c941694
Show file tree
Hide file tree
Showing 17 changed files with 23 additions and 1,616 deletions.
1 change: 1 addition & 0 deletions doc/source/whatsnew/v0.23.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ Removal of prior version deprecations/changes
- The ``Series``, ``Categorical``, and ``Index`` classes have dropped the ``reshape`` method (:issue:`13012`)
- ``pandas.tseries.frequencies.get_standard_freq`` has been removed in favor of ``pandas.tseries.frequencies.to_offset(freq).rule_code`` (:issue:`13874`)
- The ``freqstr`` keyword has been removed from ``pandas.tseries.frequencies.to_offset`` in favor of ``freq`` (:issue:`13874`)
- The ``Panel4D`` and ``PanelND`` classes have been removed (:issue:`13776`)

.. _whatsnew_0230.performance:

Expand Down
1 change: 0 additions & 1 deletion pandas/core/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
from pandas.core.series import Series
from pandas.core.frame import DataFrame
from pandas.core.panel import Panel, WidePanel
from pandas.core.panel4d import Panel4D

# TODO: Remove import when statsmodels updates #18264
from pandas.core.reshape.reshape import get_dummies
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/dtypes/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def _check(cls, inst):

ABCSeries = create_pandas_abc_type("ABCSeries", "_typ", ("series", ))
ABCDataFrame = create_pandas_abc_type("ABCDataFrame", "_typ", ("dataframe", ))
ABCPanel = create_pandas_abc_type("ABCPanel", "_typ", ("panel", "panel4d"))
ABCPanel = create_pandas_abc_type("ABCPanel", "_typ", ("panel",))
ABCSparseSeries = create_pandas_abc_type("ABCSparseSeries", "_subtyp",
('sparse_series',
'sparse_time_series'))
Expand Down
99 changes: 0 additions & 99 deletions pandas/core/panel4d.py

This file was deleted.

132 changes: 0 additions & 132 deletions pandas/core/panelnd.py

This file was deleted.

17 changes: 3 additions & 14 deletions pandas/io/pytables.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from pandas.core.dtypes.missing import array_equivalent

import numpy as np
from pandas import (Series, DataFrame, Panel, Panel4D, Index,
from pandas import (Series, DataFrame, Panel, Index,
MultiIndex, Int64Index, isna, concat, to_datetime,
SparseSeries, SparseDataFrame, PeriodIndex,
DatetimeIndex, TimedeltaIndex)
Expand Down Expand Up @@ -180,7 +180,6 @@ class DuplicateWarning(Warning):
DataFrame: u('frame'),
SparseDataFrame: u('sparse_frame'),
Panel: u('wide'),
Panel4D: u('ndim'),
}

# storer class map
Expand All @@ -203,7 +202,6 @@ class DuplicateWarning(Warning):
u('appendable_frame'): 'AppendableFrameTable',
u('appendable_multiframe'): 'AppendableMultiFrameTable',
u('appendable_panel'): 'AppendablePanelTable',
u('appendable_ndim'): 'AppendableNDimTable',
u('worm'): 'WORMTable',
u('legacy_frame'): 'LegacyFrameTable',
u('legacy_panel'): 'LegacyPanelTable',
Expand All @@ -212,8 +210,7 @@ class DuplicateWarning(Warning):
# axes map
_AXES_MAP = {
DataFrame: [0],
Panel: [1, 2],
Panel4D: [1, 2, 3],
Panel: [1, 2]
}

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


class AppendableNDimTable(AppendablePanelTable):

""" suppor the new appendable table formats """
table_type = u('appendable_ndim')
ndim = 4
obj_type = Panel4D


def _reindex_axis(obj, axis, labels, other=None):
ax = obj._get_axis(axis)
labels = _ensure_index(labels)
Expand Down
3 changes: 1 addition & 2 deletions pandas/tests/api/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ class TestPDApi(Base):
'TimedeltaIndex', 'Timestamp', 'Interval', 'IntervalIndex']

# these are already deprecated; awaiting removal
deprecated_classes = ['WidePanel', 'Panel4D', 'TimeGrouper',
'Expr', 'Term']
deprecated_classes = ['WidePanel', 'TimeGrouper', 'Expr', 'Term']

# these should be deprecated in the future
deprecated_classes_in_future = ['Panel']
Expand Down
7 changes: 0 additions & 7 deletions pandas/tests/dtypes/test_missing.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,6 @@ def test_isna_isnull(self, isna_f):
expected = p.apply(isna_f)
tm.assert_panel_equal(result, expected)

# panel 4d
with catch_warnings(record=True):
for p in [tm.makePanel4D(), tm.add_nans_panel4d(tm.makePanel4D())]:
result = isna_f(p)
expected = p.apply(isna_f)
tm.assert_panel4d_equal(result, expected)

def test_isna_lists(self):
result = isna([[False]])
exp = np.array([[False]])
Expand Down
6 changes: 0 additions & 6 deletions pandas/tests/frame/test_query_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,12 +366,6 @@ def test_raise_on_panel_with_multiindex(self, parser, engine):
with pytest.raises(NotImplementedError):
pd.eval('p + 1', parser=parser, engine=engine)

def test_raise_on_panel4d_with_multiindex(self, parser, engine):
p4d = tm.makePanel4D(7)
p4d.items = tm.makeCustomIndex(len(p4d.items), nlevels=2)
with pytest.raises(NotImplementedError):
pd.eval('p4d + 1', parser=parser, engine=engine)


@td.skip_if_no_ne
class TestDataFrameQueryNumExprPandas(object):
Expand Down
Loading

0 comments on commit c941694

Please sign in to comment.