Skip to content

Commit bc63674

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

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
@@ -2215,6 +2215,16 @@ 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+
0
2227+
>>> content = f.read()
22182228
"""
22192229
from pandas.io.parquet import to_parquet
22202230

0 commit comments

Comments
 (0)