Skip to content

Commit e975e4f

Browse files
committed
Improve to_parquet documentation
fixes #29476
1 parent 29c820f commit e975e4f

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
@@ -2225,6 +2225,16 @@ def to_parquet(
22252225
col1 col2
22262226
0 1 3
22272227
1 2 4
2228+
2229+
If you want get a buffer to the parquet content you can use a io.BytesIO object,
2230+
as long as you don't use partition_cols, which creates multiple files.
2231+
2232+
>>> import io
2233+
>>> f = io.BytesIO()
2234+
>>> df.to_parquet(f)
2235+
>>> f.seek(0)
2236+
0
2237+
>>> content = f.read()
22282238
"""
22292239
from pandas.io.parquet import to_parquet
22302240

0 commit comments

Comments
 (0)