Table Of Contents

Search

Enter search terms or a module, class or function name.

pandas.DataFrame.to_pickle

DataFrame.to_pickle(path, compression='infer', protocol=4)[source]

Pickle (serialize) object to input file path.

Parameters:

path : string

File path

compression : {‘infer’, ‘gzip’, ‘bz2’, ‘xz’, None}, default ‘infer’

a string representing the compression to use in the output file

New in version 0.20.0.

protocol : int

Int which indicates which protocol should be used by the pickler, default HIGHEST_PROTOCOL (see [1], paragraph 12.1.2). The possible values for this parameter depend on the version of Python. For Python 2.x, possible values are 0, 1, 2. For Python>=3.0, 3 is a valid value. For Python >= 3.4, 4 is a valid value.A negative value for the protocol parameter is equivalent to setting its value to HIGHEST_PROTOCOL.

[R5]

https://docs.python.org/3/library/pickle.html

New in version 0.21.0.

Scroll To Top