Write a DataFrame to the binary Feather format. Parameters ---------- path : str, path object, file-like object String, path object (implementing ``os.PathLike[str]``), or file-like object implementing a binary ``write()`` function. If a stri
(self, path: FilePath | WriteBuffer[bytes], **kwargs)
| 2831 | writer.write_file() |
| 2832 | |
| 2833 | def to_feather(self, path: FilePath | WriteBuffer[bytes], **kwargs) -> None: |
| 2834 | """ |
| 2835 | Write a DataFrame to the binary Feather format. |
| 2836 | |
| 2837 | Parameters |
| 2838 | ---------- |
| 2839 | path : str, path object, file-like object |
| 2840 | String, path object (implementing ``os.PathLike[str]``), or file-like |
| 2841 | object implementing a binary ``write()`` function. If a string or a path, |
| 2842 | it will be used as Root Directory path when writing a partitioned dataset. |
| 2843 | **kwargs : |
| 2844 | Additional keywords passed to :func:`pyarrow.feather.write_feather`. |
| 2845 | This includes the `compression`, `compression_level`, `chunksize` |
| 2846 | and `version` keywords. |
| 2847 | |
| 2848 | See Also |
| 2849 | -------- |
| 2850 | DataFrame.to_parquet : Write a DataFrame to the binary parquet format. |
| 2851 | DataFrame.to_excel : Write object to an Excel sheet. |
| 2852 | DataFrame.to_sql : Write to a sql table. |
| 2853 | DataFrame.to_csv : Write a csv file. |
| 2854 | DataFrame.to_json : Convert the object to a JSON string. |
| 2855 | DataFrame.to_html : Render a DataFrame as an HTML table. |
| 2856 | DataFrame.to_string : Convert DataFrame to a string. |
| 2857 | |
| 2858 | Notes |
| 2859 | ----- |
| 2860 | This function writes the dataframe as a `feather file |
| 2861 | <https://arrow.apache.org/docs/python/feather.html>`_. Requires a default |
| 2862 | index. For saving the DataFrame with your custom index use a method that |
| 2863 | supports custom indices e.g. `to_parquet`. |
| 2864 | |
| 2865 | Examples |
| 2866 | -------- |
| 2867 | >>> df = pd.DataFrame([[1, 2, 3], [4, 5, 6]]) |
| 2868 | >>> df.to_feather("file.feather") # doctest: +SKIP |
| 2869 | """ |
| 2870 | from pandas.io.feather_format import to_feather |
| 2871 | |
| 2872 | to_feather(self, path, **kwargs) |
| 2873 | |
| 2874 | @overload |
| 2875 | def to_markdown( |