Skip to content

Commit 0a337c1

Browse files
jbrockmendelproost
authored andcommitted
CLN: remove dead code, closes pandas-dev#28898 (pandas-dev#29470)
1 parent fe3e7a8 commit 0a337c1

File tree

3 files changed

+0
-54
lines changed

3 files changed

+0
-54
lines changed

pandas/core/frame.py

-32
Original file line numberDiff line numberDiff line change
@@ -2731,38 +2731,6 @@ def transpose(self, *args, **kwargs):
27312731

27322732
T = property(transpose)
27332733

2734-
# ----------------------------------------------------------------------
2735-
# Picklability
2736-
2737-
# legacy pickle formats
2738-
def _unpickle_frame_compat(self, state): # pragma: no cover
2739-
if len(state) == 2: # pragma: no cover
2740-
series, idx = state
2741-
columns = sorted(series)
2742-
else:
2743-
series, cols, idx = state
2744-
columns = com._unpickle_array(cols)
2745-
2746-
index = com._unpickle_array(idx)
2747-
self._data = self._init_dict(series, index, columns, None)
2748-
2749-
def _unpickle_matrix_compat(self, state): # pragma: no cover
2750-
# old unpickling
2751-
(vals, idx, cols), object_state = state
2752-
2753-
index = com._unpickle_array(idx)
2754-
dm = DataFrame(vals, index=index, columns=com._unpickle_array(cols), copy=False)
2755-
2756-
if object_state is not None:
2757-
ovals, _, ocols = object_state
2758-
objects = DataFrame(
2759-
ovals, index=index, columns=com._unpickle_array(ocols), copy=False
2760-
)
2761-
2762-
dm = dm.join(objects)
2763-
2764-
self._data = dm._data
2765-
27662734
# ----------------------------------------------------------------------
27672735
# Indexing Methods
27682736

pandas/core/generic.py

-10
Original file line numberDiff line numberDiff line change
@@ -2089,18 +2089,8 @@ def __setstate__(self, state):
20892089

20902090
else:
20912091
self._unpickle_series_compat(state)
2092-
elif isinstance(state[0], dict):
2093-
if len(state) == 5:
2094-
self._unpickle_sparse_frame_compat(state)
2095-
else:
2096-
self._unpickle_frame_compat(state)
2097-
elif len(state) == 4:
2098-
self._unpickle_panel_compat(state)
20992092
elif len(state) == 2:
21002093
self._unpickle_series_compat(state)
2101-
else: # pragma: no cover
2102-
# old pickling format, for compatibility
2103-
self._unpickle_matrix_compat(state)
21042094

21052095
self._item_cache = {}
21062096

pandas/io/pickle.py

-12
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
""" pickle compat """
2-
from io import BytesIO
32
import pickle
43
import warnings
54

6-
from numpy.lib.format import read_array
7-
85
from pandas.compat import PY36, pickle_compat as pc
96

107
from pandas.io.common import _get_handle, _stringify_path
@@ -164,12 +161,3 @@ def read_pickle(path, compression="infer"):
164161
f.close()
165162
for _f in fh:
166163
_f.close()
167-
168-
169-
# compat with sparse pickle / unpickle
170-
171-
172-
def _unpickle_array(bytes):
173-
arr = read_array(BytesIO(bytes))
174-
175-
return arr

0 commit comments

Comments
 (0)