Skip to content

Commit

Permalink
CLN: remove dead code, closes pandas-dev#28898 (pandas-dev#29470)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrockmendel authored and jreback committed Nov 7, 2019
1 parent a109a5d commit 5983b46
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 54 deletions.
32 changes: 0 additions & 32 deletions pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -2731,38 +2731,6 @@ def transpose(self, *args, **kwargs):

T = property(transpose)

# ----------------------------------------------------------------------
# Picklability

# legacy pickle formats
def _unpickle_frame_compat(self, state): # pragma: no cover
if len(state) == 2: # pragma: no cover
series, idx = state
columns = sorted(series)
else:
series, cols, idx = state
columns = com._unpickle_array(cols)

index = com._unpickle_array(idx)
self._data = self._init_dict(series, index, columns, None)

def _unpickle_matrix_compat(self, state): # pragma: no cover
# old unpickling
(vals, idx, cols), object_state = state

index = com._unpickle_array(idx)
dm = DataFrame(vals, index=index, columns=com._unpickle_array(cols), copy=False)

if object_state is not None:
ovals, _, ocols = object_state
objects = DataFrame(
ovals, index=index, columns=com._unpickle_array(ocols), copy=False
)

dm = dm.join(objects)

self._data = dm._data

# ----------------------------------------------------------------------
# Indexing Methods

Expand Down
10 changes: 0 additions & 10 deletions pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -2089,18 +2089,8 @@ def __setstate__(self, state):

else:
self._unpickle_series_compat(state)
elif isinstance(state[0], dict):
if len(state) == 5:
self._unpickle_sparse_frame_compat(state)
else:
self._unpickle_frame_compat(state)
elif len(state) == 4:
self._unpickle_panel_compat(state)
elif len(state) == 2:
self._unpickle_series_compat(state)
else: # pragma: no cover
# old pickling format, for compatibility
self._unpickle_matrix_compat(state)

self._item_cache = {}

Expand Down
12 changes: 0 additions & 12 deletions pandas/io/pickle.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
""" pickle compat """
from io import BytesIO
import pickle
import warnings

from numpy.lib.format import read_array

from pandas.compat import PY36, pickle_compat as pc

from pandas.io.common import _get_handle, _stringify_path
Expand Down Expand Up @@ -164,12 +161,3 @@ def read_pickle(path, compression="infer"):
f.close()
for _f in fh:
_f.close()


# compat with sparse pickle / unpickle


def _unpickle_array(bytes):
arr = read_array(BytesIO(bytes))

return arr

0 comments on commit 5983b46

Please sign in to comment.