pyspark.pandas.DataFrame.to_feather#

DataFrame.to_feather(path, **kwargs)[source]#

Write a DataFrame to the binary Feather format.

Note

This method should only be used if the resulting DataFrame is expected to be small, as all the data is loaded into the driver’s memory.

New in version 4.0.0.

Parameters
pathstr, path object, file-like object

String, path object (implementing os.PathLike[str]), or file-like object implementing a binary write() function.

**kwargs

Additional keywords passed to pyarrow.feather.write_feather(). This includes the compression, compression_level, chunksize and version keywords.

Examples

>>> df = ps.DataFrame([[1, 2, 3], [4, 5, 6]])
>>> df.to_feather("file.feather")