Skip to content

CLN: remove dead code, closes #28898 #29470

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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