From 5e71dcdc4dc55b43ebbfb4841a118584cdeebc52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dea=20Mar=C3=ADa=20L=C3=A9on?= Date: Thu, 20 Jul 2023 21:02:42 +0200 Subject: [PATCH 1/2] to_feather example --- ci/code_checks.sh | 1 - pandas/io/feather_format.py | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 5fc8f02a3fa8d..e018e26dfff35 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -76,7 +76,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then pandas.test \ pandas.NaT \ pandas.read_feather \ - pandas.DataFrame.to_feather \ pandas.read_orc \ pandas.read_sas \ pandas.read_spss \ diff --git a/pandas/io/feather_format.py b/pandas/io/feather_format.py index 045eb7201631c..6bae57e926992 100644 --- a/pandas/io/feather_format.py +++ b/pandas/io/feather_format.py @@ -50,6 +50,10 @@ def to_feather( **kwargs : Additional keywords passed to `pyarrow.feather.write_feather`. + Examples + -------- + >>> df = pd.DataFrame({'A' : [1, 2, 3], 'B' : [4, 5, 6]}) + >>> df.to_feather("file.feather") # doctest: +SKIP """ import_optional_dependency("pyarrow") from pyarrow import feather From 5da594444cfc92f5ec80fdf46f1060ffcad4bd8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dea=20Mar=C3=ADa=20L=C3=A9on?= Date: Thu, 20 Jul 2023 21:20:16 +0200 Subject: [PATCH 2/2] examples on correct file --- pandas/core/frame.py | 5 +++++ pandas/io/feather_format.py | 4 ---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pandas/core/frame.py b/pandas/core/frame.py index a57caa68ce738..b23c3ad086acf 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -2757,6 +2757,11 @@ def to_feather(self, path: FilePath | WriteBuffer[bytes], **kwargs) -> None: `_. Requires a default index. For saving the DataFrame with your custom index use a method that supports custom indices e.g. `to_parquet`. + + Examples + -------- + >>> df = pd.DataFrame([[1, 2, 3], [4, 5, 6]]) + >>> df.to_feather("file.feather") # doctest: +SKIP """ from pandas.io.feather_format import to_feather diff --git a/pandas/io/feather_format.py b/pandas/io/feather_format.py index 6bae57e926992..045eb7201631c 100644 --- a/pandas/io/feather_format.py +++ b/pandas/io/feather_format.py @@ -50,10 +50,6 @@ def to_feather( **kwargs : Additional keywords passed to `pyarrow.feather.write_feather`. - Examples - -------- - >>> df = pd.DataFrame({'A' : [1, 2, 3], 'B' : [4, 5, 6]}) - >>> df.to_feather("file.feather") # doctest: +SKIP """ import_optional_dependency("pyarrow") from pyarrow import feather