Skip to content

DOC: show Parquet examples with default engine (without explicit pyarrow/fastparquet engine keyword) #61877

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 16, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 6 additions & 19 deletions doc/source/user_guide/io.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5280,24 +5280,21 @@ Write to a parquet file.

.. ipython:: python

df.to_parquet("example_pa.parquet", engine="pyarrow")
df.to_parquet("example_fp.parquet", engine="fastparquet")
# specify engine="pyarrow" or engine="fastparquet" to use a specific engine
df.to_parquet("example.parquet")

Read from a parquet file.

.. ipython:: python

result = pd.read_parquet("example_fp.parquet", engine="fastparquet")
result = pd.read_parquet("example_pa.parquet", engine="pyarrow")

result = pd.read_parquet("example.parquet")
result.dtypes

By setting the ``dtype_backend`` argument you can control the default dtypes used for the resulting DataFrame.

.. ipython:: python

result = pd.read_parquet("example_pa.parquet", engine="pyarrow", dtype_backend="pyarrow")

result = pd.read_parquet("example.parquet", dtype_backend="pyarrow")
result.dtypes

.. note::
Expand All @@ -5309,24 +5306,14 @@ Read only certain columns of a parquet file.

.. ipython:: python

result = pd.read_parquet(
"example_fp.parquet",
engine="fastparquet",
columns=["a", "b"],
)
result = pd.read_parquet(
"example_pa.parquet",
engine="pyarrow",
columns=["a", "b"],
)
result = pd.read_parquet("example.parquet", columns=["a", "b"])
result.dtypes


.. ipython:: python
:suppress:

os.remove("example_pa.parquet")
os.remove("example_fp.parquet")
os.remove("example.parquet")


Handling indexes
Expand Down
Loading