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 resample 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 resample 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.resample

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:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
martharobinsoncommented, Oct 17, 2018

Yes, sorry life intervened and prevented me from finishing this! Sorry for not making that clear.

1reaction
jmrrcommented, Oct 16, 2018

Hey @datapythonista as the last person who volunteered didn’t eventually open a PR I took a stab at this and made good progress during the London Python Sprints Hacktoberfest meetup, hope I didn’t break any pandas etiquette here.

I have a question. The validate_docstrings script produces errors with deprecated parameters, e.g. Parameters {fill_method, limit, how} not documented. What is the policy with these parameters?

Thanks!

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 >
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 - How do you fix "Missing module docstringpylint ...
A python module's docstring documents what the contents of that file are for. You can solve this error by adding a docstring at...
Read more >
Documenting Python APIs with docstrings
We use Python docstrings to create reference documentation for our Python APIs. ... set of standard Numpydoc sections (see Numpydoc sections in docstrings)....
Read more >
Google Python Style Guide
pylint warnings are each identified by symbolic name ( empty-docstring ) Google-specific warnings start with g- . If the reason for the suppression...
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