pandas.DataFrame.to_pickle
pandas 3.1.1 · DataFrame · method
Serialize a Python object into a pickle file for later restoration.
Call syntax
DataFrame.to_pickle(path, *, compression='infer', protocol=5, storage_options=None)Run the example
Edit the example and select Run Python to see the result.
Parameters
| Parameter | Requirement | Accepted values and behavior |
|---|---|---|
path |
Required Positional or keyword |
str, path object, or file-like object Supply a file path or file-like object where supported. |
compression |
Optional Keyword only Default 'infer' |
str or dict Choose whether and how to compress or decompress data. |
protocol |
Optional Keyword only Default 5 |
int |
storage_options |
Optional Keyword only Default None |
dict Pass storage-backend options such as connection settings or HTTP headers. |
Returns
None