-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: Add TextFileReader to docs #46308
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 1 commit
1e91695
d10d829
59ecfdf
1e487ad
0192267
6db27ea
c367d3d
db74d99
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 |
---|---|---|
|
@@ -25,6 +25,19 @@ Flat file | |
DataFrame.to_csv | ||
read_fwf | ||
|
||
.. currentmodule:: pandas.io.parsers | ||
|
||
.. autosummary:: | ||
:toctree: api/ | ||
|
||
TextFileReader | ||
|
||
TextFileReader.get_chunk | ||
TextFileReader.close | ||
TextFileReader.read | ||
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.
with pd.read_csv("test.csv", iterator=True) as reader:
for chunk in reader:
print(chunk) 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. Would need to add a doc-string to |
||
|
||
.. currentmodule:: pandas | ||
|
||
Clipboard | ||
~~~~~~~~~ | ||
.. autosummary:: | ||
|
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.
We obviously don't want to add these. But when I remove them, sphinx complains that it can not find them in any toctree. Anyone any ideas how to solve this? For ExcelWriter below this works, so I am probably missing something.
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.
I think in the past we used a section with
:hidden:
, like in https://github.com/pandas-dev/pandas/blame/main/doc/source/getting_started/index.rst#L641But I don't see it being used for the API anymore. I guess we should just make them private by using
_get_chunk
... if we don't want them public and in the documentation.Or maybe just
_TextFileReader
and make the whole class private if we don't want it being part of our public API.I'm personally fine with any of them.
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.
I think we could deprecate it and remove it later, that sounds good to me.
We can't makeTextFileReader private, since it is returned by read_csv if you are reading the file in chunks
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.
Ah, true. Sounds good to me then. Also find to simply document the methods and publish them in the docs. Maybe we can just add a not for now that we recommend using the magic methods way.