DOC: Fix docstring of read_csv and related methods
See original GitHub issueThe next Excel related functions contain many errors as reported by scripts/validate_docstrings.py
:
- pandas.read_table
- pandas.read_csv
- pandas.read_fwf
We should fix them, following our standards: https://pandas.pydata.org/pandas-docs/stable/contributing_docstring.html
The validation script should not report errors after they are fixed.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
pandas docstring guide — pandas 1.5.2 documentation
About docstrings and standards#. A Python docstring is a string used to document a Python module, class, function or method, so programmers can...
Read more >Complete Guide to Python Docstring - eduCBA
Class Docstrings are the documentation for the class and its relevant methods. The purpose of the class docstring is to provide a clear...
Read more >Documenting Python Code: A Complete Guide
Module docstrings are similar to class docstrings. Instead of classes and class methods being documented, it's now the module and any functions found...
Read more >Insert docstring attributes in a python file - Stack Overflow
Get the existing docstring using ast. · Create a new ast node with amended content · If the existing dostring is None ,...
Read more >Python Docstrings (With Examples) - Programiz
Python __doc__ attribute. Whenever string literals are present just after the definition of a function, module, class or method, they are associated with...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For 1, I think there is a missing blank line between the name/type line, and the directive. Not sure if that’s the cause. But I guess it’s related to the
.. deprecated::
directive. You can also do a grep of that directive, see if docstrings containing it for a parameter have the same validation error, and if you think it’s a problem in the validation script, ignore the error and create an issue (mention #20298 and myself in the issue, so I add it to the list).For 2, you can add a couple of prints in the property
double_blank_lines
for debugging (don’t commit that).One that prints every line, and one that prints when the two blank lines are found. That should give you a better idea of what’s the exact problem.Let me know if you need help.
This one is a bit tricky. We validate that the signature and the documented parameters match. So:
Will generate an error that
arg2
is unknown, andkwargs
is not documented. Which makes sense.What happen is that
read_fwf
was implemented, so most of the parameters are not explicit in the signature, butkwargs
is used instead.Personally, I think the right solution is to change the signature, and add all them. But that’s trickier than just changing the docstrings. Shouldn’t break anything, but it’s more risky than just touching docs.
@jreback any reason why we should not add these parameters to the signature?