Skip to content

Commit d5e8edc

Browse files
authored
DOC: Improve to_parquet documentation (#33709)
1 parent 1cad9e5 commit d5e8edc

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pandas/core/frame.py

+10
Original file line numberDiff line numberDiff line change
@@ -2292,6 +2292,16 @@ def to_parquet(
22922292
col1 col2
22932293
0 1 3
22942294
1 2 4
2295+
2296+
If you want to get a buffer to the parquet content you can use a io.BytesIO
2297+
object, as long as you don't use partition_cols, which creates multiple files.
2298+
2299+
>>> import io
2300+
>>> f = io.BytesIO()
2301+
>>> df.to_parquet(f)
2302+
>>> f.seek(0)
2303+
0
2304+
>>> content = f.read()
22952305
"""
22962306
from pandas.io.parquet import to_parquet
22972307

0 commit comments

Comments
 (0)