pandas.DataFrame.to_parquet¶
Write a DataFrame to the binary parquet format.
New in version 0.21.0.
This function writes the dataframe as a parquet file. You can choose different parquet backends, and have the option of compression. See the user guide for more details.
- param fname
- str
File path or Root Directory path. Will be used as Root Directory path while writing a partitioned dataset.
Changed in version 0.24.0.
- param engine
- {‘auto’, ‘pyarrow’, ‘fastparquet’}, default ‘auto’
Parquet library to use. If ‘auto’, then the option
io.parquet.engineis used. The defaultio.parquet.enginebehavior is to try ‘pyarrow’, falling back to ‘fastparquet’ if ‘pyarrow’ is unavailable.
- param compression
- {‘snappy’, ‘gzip’, ‘brotli’, None}, default ‘snappy’
Name of the compression to use. Use
Nonefor no compression.
- param index
- bool, default None
If
True, include the dataframe’s index(es) in the file output. IfFalse, they will not be written to the file. IfNone, the behavior depends on the chosen engine.New in version 0.24.0.
- param partition_cols
- list, optional, default None
Column names by which to partition the dataset Columns are partitioned in the order they are given
New in version 0.24.0.
**kwargs Additional arguments passed to the parquet library. See pandas io for more details.
Warning
This feature is currently unsupported by Intel Scalable Dataframe Compiler