pandas.read_pickle(path, compression='infer')
[source]
Load pickled pandas object (or any object) from file.
Warning
Loading pickled data received from untrusted sources can be unsafe. See here.
Parameters: |
|
---|---|
Returns: |
|
See also
DataFrame.to_pickle
Series.to_pickle
read_hdf
read_sql
read_parquet
read_pickle is only guaranteed to be backwards compatible to pandas 0.20.3.
>>> original_df = pd.DataFrame({"foo": range(5), "bar": range(5, 10)}) >>> original_df foo bar 0 0 5 1 1 6 2 2 7 3 3 8 4 4 9 >>> pd.to_pickle(original_df, "./dummy.pkl")
>>> unpickled_df = pd.read_pickle("./dummy.pkl") >>> unpickled_df foo bar 0 0 5 1 1 6 2 2 7 3 3 8 4 4 9
>>> import os >>> os.remove("./dummy.pkl")
© 2008–2012, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
Licensed under the 3-clause BSD License.
https://pandas.pydata.org/pandas-docs/version/0.25.0/reference/api/pandas.read_pickle.html