Pandas DataFrame: to_pickle() function
DataFrame - to_pickle() function
The to_pickle() function is used to pickle (serialize) object to file.
Syntax:
DataFrame.to_pickle(self, path, compression='infer', protocol=4)
Parameters:
Name | Description | Type/Default Value | Required / Optional |
---|---|---|---|
path | File path where the pickled object will be stored. | str | Required |
compression | A string representing the compression to use in the output file. By default, infers from the file extension in specified path. | {'infer', 'gzip', 'bz2', 'zip', 'xz', None} Default Value: 'infer' |
Required |
protocol | Int which indicates which protocol should be used by the pickler, default HIGHEST_PROTOCOL | int | Required |
Example:
Download the Pandas DataFrame Notebooks from here.
Previous: DataFrame - to_parquet() function
Next: DataFrame - to_csv() function
- New Content published on w3resource:
- HTML-CSS Practical: Exercises, Practice, Solution
- Java Regular Expression: Exercises, Practice, Solution
- Scala Programming Exercises, Practice, Solution
- Python Itertools exercises
- Python Numpy exercises
- Python GeoPy Package exercises
- Python Pandas exercises
- Python nltk exercises
- Python BeautifulSoup exercises
- Form Template
- Composer - PHP Package Manager
- PHPUnit - PHP Testing
- Laravel - PHP Framework
- Angular - JavaScript Framework
- Vue - JavaScript Framework
- Jest - JavaScript Testing Framework