DOC: Fix the docstring of xs in pandas/core/generic.py
See original GitHub issuepandas docstring are expected to follow the format defined in https://pandas.pydata.org/pandas-docs/stable/contributing_docstring.html
This includes among other things:
- There is a short description fitting in one line (there can be a longer one after that).
- The description of the parameters, the returns section, and the see also items, starts with a capital letter and ends with a period.
- In the Return section there is no name before the type (e.g.
transformed : Series
) but just the type (e.g.Series
) in the first line. - The examples are valid PEP-8 code, and when executed, they produce the shown input.
We should make the required adjustments in the docstring of the function xs
in pandas/core/generic.py
.
We should validate the docstring with our validator (which does not validate all the formats, but some):
./scripts/validate_docstrings.py pandas.Series.xs
And we should validate the PEP-8 of the examples (note that the next command will validate the PEP-8 of all examples, just make sure that none of the shown is in the function being addressed, the rest will be fixed in separate issues):
flake8 --doctests pandas/core/generic.py
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
pandas docstring guide — pandas 1.5.2 documentation
A Python docstring is a string used to document a Python module, class, ... In case where there are just a set of...
Read more >python - Setting the docstring to an expression inside def
The only way you can dynamically set a function's docstring is by referring to a function object directly and setting it's __doc__ or...
Read more >Python Docstrings - GeeksforGeeks
It's specified in source code that is used, like a comment, to document a specific segment of code. Unlike conventional source code comments, ......
Read more >How to Use Python Docstrings for Effective Code Documentation
Documenting your code is a critical skill for any data scientist or software engineer. This tutorial will show you how using docstrings.
Read more >Python Docstring: Documenting And Introspecting Functions
This tutorial explains what is Python Docstring and how to use it to document Python functions with examples.
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
I’d like to work on this issue
Hi ! I will help on this one