Skip to content

Commit 12e0705

Browse files
committed
DEPR: Remove pd.load/pd.save aliases in favor of pd.to_pickle/pd.read_pickle, #3787
1 parent 245791c commit 12e0705

File tree

4 files changed

+1
-55
lines changed

4 files changed

+1
-55
lines changed

doc/source/whatsnew/v0.17.0.txt

+1
Original file line numberDiff line numberDiff line change
@@ -712,6 +712,7 @@ Removal of prior version deprecations/changes
712712
- Remove ``kind`` in ``read_excel/ExcelFile`` as its unused (:issue:`4712`)
713713
- Remove ``infer_type`` keyword from ``pd.read_html`` as its unused (:issue:`4770`, :issue:`7032`)
714714
- Remove ``offset`` and ``timeRule`` keywords from ``Series.tshift/shift``, in favor of ``freq`` (:issue:`4853`, :issue:`4864`)
715+
- Remove ``pd.load/pd.save`` aliases in favor of ``pd.to_pickle/pd.read_pickle`` (:issue:`3787`)
715716

716717
.. _whatsnew_0170.performance:
717718

pandas/core/api.py

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
from pandas.tseries.period import Period, PeriodIndex
3030

3131
# legacy
32-
from pandas.core.common import save, load # deprecated, remove in 0.13
3332
import pandas.core.datetools as datetools
3433

3534
from pandas.core.config import (get_option, set_option, reset_option,

pandas/core/common.py

-40
Original file line numberDiff line numberDiff line change
@@ -3313,46 +3313,6 @@ def console_encode(object, **kwds):
33133313
return pprint_thing_encoded(object,
33143314
get_option("display.encoding"))
33153315

3316-
3317-
def load(path): # TODO remove in 0.13
3318-
"""
3319-
Load pickled pandas object (or any other pickled object) from the specified
3320-
file path
3321-
3322-
Warning: Loading pickled data received from untrusted sources can be
3323-
unsafe. See: http://docs.python.org/2.7/library/pickle.html
3324-
3325-
Parameters
3326-
----------
3327-
path : string
3328-
File path
3329-
3330-
Returns
3331-
-------
3332-
unpickled : type of object stored in file
3333-
"""
3334-
import warnings
3335-
warnings.warn("load is deprecated, use read_pickle", FutureWarning)
3336-
from pandas.io.pickle import read_pickle
3337-
return read_pickle(path)
3338-
3339-
3340-
def save(obj, path): # TODO remove in 0.13
3341-
"""
3342-
Pickle (serialize) object to input file path
3343-
3344-
Parameters
3345-
----------
3346-
obj : any object
3347-
path : string
3348-
File path
3349-
"""
3350-
import warnings
3351-
warnings.warn("save is deprecated, use obj.to_pickle", FutureWarning)
3352-
from pandas.io.pickle import to_pickle
3353-
return to_pickle(obj, path)
3354-
3355-
33563316
def _maybe_match_name(a, b):
33573317
a_has = hasattr(a, 'name')
33583318
b_has = hasattr(b, 'name')

pandas/core/generic.py

-14
Original file line numberDiff line numberDiff line change
@@ -1006,20 +1006,6 @@ def to_pickle(self, path):
10061006
from pandas.io.pickle import to_pickle
10071007
return to_pickle(self, path)
10081008

1009-
def save(self, path): # TODO remove in 0.14
1010-
"Deprecated. Use to_pickle instead"
1011-
import warnings
1012-
from pandas.io.pickle import to_pickle
1013-
warnings.warn("save is deprecated, use to_pickle", FutureWarning)
1014-
return to_pickle(self, path)
1015-
1016-
def load(self, path): # TODO remove in 0.14
1017-
"Deprecated. Use read_pickle instead."
1018-
import warnings
1019-
from pandas.io.pickle import read_pickle
1020-
warnings.warn("load is deprecated, use pd.read_pickle", FutureWarning)
1021-
return read_pickle(path)
1022-
10231009
def to_clipboard(self, excel=None, sep=None, **kwargs):
10241010
"""
10251011
Attempt to write text representation of object to the system clipboard

0 commit comments

Comments
 (0)