Skip to content

Commit f55ce5f

Browse files
committed
Improve to_parquet documentation
fixes pandas-dev#29476
1 parent 8282ee2 commit f55ce5f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

pandas/io/parquet.py

+11
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,17 @@ def to_parquet(
245245
246246
kwargs
247247
Additional keyword arguments passed to the engine
248+
249+
Examples
250+
--------
251+
If you want get a buffer to the parquet content you can use a io.BytesIO object
252+
>>> f = io.BytesIO()
253+
>>> df.to_parquet(f)
254+
>>> f.seek(0)
255+
>>> len(f.read())
256+
257+
Or simply a path:
258+
>>> df.to_parquet('df.parquet')
248259
"""
249260
if isinstance(partition_cols, str):
250261
partition_cols = [partition_cols]

0 commit comments

Comments
 (0)