-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: update the parquet docstring #20129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
6d25e6c
14ed668
7b7f8bc
7ec8537
39423cd
d08f6b2
b5329d2
e65840c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1697,19 +1697,42 @@ def to_parquet(self, fname, engine='auto', compression='snappy', | |
|
||
.. versionadded:: 0.21.0 | ||
|
||
This function writes the dataframe as a parquet file. You | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you add a link to the parquet docs (copy from io.rst) in References |
||
can choose different parquet backends, and have the option | ||
of compressing. | ||
|
||
Parameters | ||
---------- | ||
fname : str | ||
string file path | ||
String file path. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IIRC we use lower for these? @jorisvandenbossche There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here it is fine as start of the sentence and not being the exact type |
||
engine : {'auto', 'pyarrow', 'fastparquet'}, default 'auto' | ||
Parquet library to use. If 'auto', then the option | ||
``io.parquet.engine`` is used. The default ``io.parquet.engine`` | ||
behavior is to try 'pyarrow', falling back to 'fastparquet' if | ||
'pyarrow' is unavailable. | ||
compression : {'snappy', 'gzip', 'brotli', None}, default 'snappy' | ||
Name of the compression to use. Use ``None`` for no compression. | ||
kwargs | ||
Additional keyword arguments passed to the engine | ||
kwargs : dict | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you change this line to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Writing it as **kwargs results in a validation error:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can ignore that error (the validation script is not yet perfect here :-)) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for clarifying! |
||
Additional keyword arguments passed to the engine. | ||
|
||
Returns | ||
---------- | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are to many hyphens. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. make the underlines the same length as the title |
||
None | ||
|
||
See Also | ||
-------- | ||
DataFrame.to_csv : write a csv file. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. link to |
||
DataFrame.to_sql : write to a sql table. | ||
DataFrame.to_hdf : write to hdf. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For the "See Also" section, please check the section 5 of https://python-sprints.github.io/pandas/guide/pandas_docstring.html |
||
|
||
Notes | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same |
||
---------- | ||
Requires either fastparquet or pyarrow libraries. | ||
|
||
Examples | ||
---------- | ||
>>> df = pd.DataFrame(data={'col1': [1, 2], 'col2': [3, 4]}) | ||
>>> df.to_parquet('df.parquet.gzip', compression='gzip') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you also show using read_parquet to read this back |
||
""" | ||
from pandas.io.parquet import to_parquet | ||
to_parquet(self, fname, engine, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An extended summary is necessary.