Skip to content

Commit 9ef67b1

Browse files
galuhsahidjorisvandenbossche
authored andcommitted
DOC: Update index parameter in pandas to_parquet (pandas-dev#28217)
1 parent 944e26e commit 9ef67b1

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

pandas/core/frame.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -2183,8 +2183,12 @@ def to_parquet(
21832183
Name of the compression to use. Use ``None`` for no compression.
21842184
index : bool, default None
21852185
If ``True``, include the dataframe's index(es) in the file output.
2186-
If ``False``, they will not be written to the file. If ``None``,
2187-
the behavior depends on the chosen engine.
2186+
If ``False``, they will not be written to the file.
2187+
If ``None``, similar to ``True`` the dataframe's index(es)
2188+
will be saved. However, instead of being saved as values,
2189+
the RangeIndex will be stored as a range in the metadata so it
2190+
doesn't require much space and is faster. Other indexes will
2191+
be included as columns in the file output.
21882192
21892193
.. versionadded:: 0.24.0
21902194

pandas/io/parquet.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,12 @@ def to_parquet(
227227
Name of the compression to use. Use ``None`` for no compression.
228228
index : bool, default None
229229
If ``True``, include the dataframe's index(es) in the file output. If
230-
``False``, they will not be written to the file. If ``None``, the
231-
engine's default behavior will be used.
230+
``False``, they will not be written to the file.
231+
If ``None``, similar to ``True`` the dataframe's index(es)
232+
will be saved. However, instead of being saved as values,
233+
the RangeIndex will be stored as a range in the metadata so it
234+
doesn't require much space and is faster. Other indexes will
235+
be included as columns in the file output.
232236
233237
.. versionadded:: 0.24.0
234238

0 commit comments

Comments
 (0)