Skip to content

DOC Series.sort_values docstring [Sao Paulo] #1

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

Merged
merged 4 commits into from
Mar 10, 2018
Merged

Conversation

rafarui
Copy link
Owner

@rafarui rafarui commented Mar 10, 2018

Checklist for the pandas documentation sprint (ignore this if you are doing
an unrelated PR):

  • PR title is "DOC: update the docstring"
  • The validation script passes: scripts/validate_docstrings.py <your-function-or-method>
  • The PEP8 style check passes: git diff upstream/master -u -- "*.py" | flake8 --diff
  • The html version looks good: python doc/make.py --single <your-function-or-method>
  • It has been proofread on language by another sprint participant

Please include the output of the validation script below between the "```" ticks:

# paste output of "scripts/validate_docstrings.py <your-function-or-method>" here
# between the "```" (remove this comment, but keep the "```")

If the validation script still gives errors, but you think there is a good reason
to deviate in this case (and there are certainly such cases), please state this
explicitly.

Checklist for other PRs (remove this part if you are doing a PR for the pandas documentation sprint):

  • closes #xxxx
  • tests added / passed
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • whatsnew entry


**Sort values ascending order**

>>> s.sort_values(ascending= True)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No spaces surrounding = for keyword arguments.


**Sort values descending order**

>>> s.sort_values(ascending= False)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No spaces surrounding = for keyword arguments.


**Sort values inplace**

>>> s.sort_values(ascending= False, inplace= True)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No spaces surrounding = for keyword arguments.


**Sort values putting NAs first**

>>> s.sort_values(na_position= 'first')
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No spaces surrounding = for keyword arguments.

@villasv
Copy link

villasv commented Mar 10, 2018

PEP8: 4th bullet point in: https://www.python.org/dev/peps/pep-0008/#other-recommendations


Returns
-------
sorted_obj : Series
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Returned values need not to be named except if inside tuples.

7 45.0
dtype: float64

**Sort values ascending order**
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this using bold font? The guidelines don't forbid it explicitly but simply says:

Sort values ascending order:

Copy link

@igorcadelima igorcadelima left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace "Sort ascending (True) or descending (False)." with "True if ascending sort or False otherwise."

@rafarui rafarui merged commit 4aea67c into master Mar 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants