Skip to content

DOC add example to reorder levels #42935

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 6 commits into from
Aug 23, 2021
Merged

Conversation

trevorkask
Copy link
Contributor

@trevorkask trevorkask commented Aug 8, 2021

Response to changes suggested on my previous pull request

Response to changes suggested on my previous pull request
@pep8speaks
Copy link

pep8speaks commented Aug 8, 2021

Hello @trevorkask! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2021-08-23 15:16:42 UTC

Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

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

Have you tried building the docs to check this looks right?

https://pandas.pydata.org/pandas-docs/stable/development/contributing_documentation.html

@attack68
Copy link
Contributor

attack68 commented Aug 8, 2021

Are you going to close #42667 or this? You should really continue that PR and close this one.

@jreback jreback mentioned this pull request Aug 13, 2021
4 tasks
Fixed the indentation issue
Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

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

Can you try building the docs for this function locally to check it renders fine? (hint: at the moment it won't, this'll help you tell whether the PR is ready)

Comment on lines 6793 to 6795
"""
Examples
--------
Copy link
Member

Choose a reason for hiding this comment

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

This won't render, it needs to be inside the docstring

'species':['Humans','Dogs','Snakes','Iguanas','Frogs','Aquatic Salamanders']
}
>>> df=pd.DataFrame(data,columns=['class','diet','species'])
>>> df.set_index(['class','diet'],drop=True,inplace=True)
Copy link
Member

Choose a reason for hiding this comment

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

can you write this without using inplace=True please?

@MarcoGorelli MarcoGorelli mentioned this pull request Aug 15, 2021
@jreback
Copy link
Contributor

jreback commented Aug 16, 2021

use this one

Built the example inside the docstring and removed the unnecessary inplace=true
@MarcoGorelli MarcoGorelli changed the title Update frame.py DOC add example to reorder levels Aug 18, 2021
@jreback jreback added the Docs label Aug 20, 2021
Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

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

Hi @trevorkask - the example looks good, there's just some stylistic errors

Can you fix them up? See https://pandas.pydata.org/pandas-docs/stable/development/contributing_codebase.html?highlight=pre%20commit#pre-commit

@MarcoGorelli MarcoGorelli added this to the 1.4 milestone Aug 23, 2021
Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

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

@MarcoGorelli MarcoGorelli merged commit 4a20781 into pandas-dev:master Aug 23, 2021
@MarcoGorelli
Copy link
Member

Thanks @trevorkask

feefladder pushed a commit to feefladder/pandas that referenced this pull request Sep 7, 2021
* Update frame.py

Response to changes suggested on my previous pull request

* Update frame.py

Fixed the indentation issue

* Update frame.py

Built the example inside the docstring and removed the unnecessary inplace=true

* fixup

Co-authored-by: Marco Gorelli <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DOC add example to reorder levels
5 participants