Skip to content

Commit 8f47559

Browse files
committed
Improve to_parquet documentation
fixes #29476
1 parent 8282ee2 commit 8f47559

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pandas/core/frame.py

+9
Original file line numberDiff line numberDiff line change
@@ -2215,6 +2215,15 @@ def to_parquet(
22152215
col1 col2
22162216
0 1 3
22172217
1 2 4
2218+
2219+
If you want get a buffer to the parquet content you can use a io.BytesIO object,
2220+
as long as you don't use partition_cols, which creates multiple files.
2221+
2222+
>>> import io
2223+
>>> f = io.BytesIO()
2224+
>>> df.to_parquet(f)
2225+
>>> f.seek(0)
2226+
>>> content=f.read()
22182227
"""
22192228
from pandas.io.parquet import to_parquet
22202229

0 commit comments

Comments
 (0)