question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DOC: Fix the docstring of xs in pandas/core/generic.py

See original GitHub issue

pandas 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:closed
  • Created 5 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
srihari-palivelacommented, Oct 9, 2018

I’d like to work on this issue

0reactions
tlentalicommented, Nov 22, 2018

Hi ! I will help on this one

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found