pandas.Series.to_pickle

pandas 3.1.1 · Series and accessors · method

Serialize a Python object into a pickle file for later restoration.

Call syntax

Series.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

ParameterRequirementAccepted 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