From d5e8edcdfa0eaf6847faf95e15a607e03068eb4c Mon Sep 17 00:00:00 2001 From: Pedro Larroy Date: Sat, 30 May 2020 09:32:51 -0700 Subject: [PATCH] DOC: Improve to_parquet documentation (#33709) --- pandas/core/frame.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 2666597cbf765..68608daf2277e 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -2292,6 +2292,16 @@ def to_parquet( col1 col2 0 1 3 1 2 4 + + If you want to get a buffer to the parquet content you can use a io.BytesIO + object, as long as you don't use partition_cols, which creates multiple files. + + >>> import io + >>> f = io.BytesIO() + >>> df.to_parquet(f) + >>> f.seek(0) + 0 + >>> content = f.read() """ from pandas.io.parquet import to_parquet