Skip to content

DOC: Edit MultiIndex.set_levels() docstring to clarify that set_levels() interprets passed values as new components of the .levels attribute (#28294) #29143

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

Conversation

hweecat
Copy link
Contributor

@hweecat hweecat commented Oct 22, 2019

Added documentation on MultiIndex.set_levels to clarify that MultiIndex.set_levels() interprets passed values as new components of the .levels attribute. Continuation of #28797 due to issues with Travis CI for Python 3.8 and subsequent git diff issues resulting from resolution of Travis CI issues.

…-set_levels

update branch with new changes in project
@jbrockmendel
Copy link
Member

can you rebase

@hweecat
Copy link
Contributor Author

hweecat commented Nov 6, 2019

Hello @jbrockmendel, do you mean 'git rebase upstream/master' or 'git fetch upstream && git merge upstream/master' to resolve conflicts?

Just wanted to confirm in order to avoid the git diff issues I encountered earlier in #28797

@jbrockmendel
Copy link
Member

do you mean 'git rebase upstream/master' or 'git fetch upstream && git merge upstream/master' to resolve conflicts?

I usually do git pull upstream master and manually resolve any conflicts.

@hweecat
Copy link
Contributor Author

hweecat commented Nov 6, 2019

Not sure what happened, but I did a git fetch upstream, git pull upstream/master, manually resolved conflicts, and git push origin on my branch - and my tests are failing.

Edit: Did a git fetch upstream && git merge upstream/master, checked black pandas and git diff, and git push origin on my branch to get latest updates - tests passed.

Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

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

Some minor edits; this is a rather tough concept to express so I think if we can make succinct will help explain better

@WillAyd WillAyd added this to the 1.0 milestone Nov 9, 2019
@WillAyd
Copy link
Member

WillAyd commented Nov 9, 2019

lgtm @gfyoung care to take a look?


If any of the levels passed to ``set_levels()`` exceeds the
existing length, all of the values from that argument will
be stored though truncated in the MultiIndex output.
Copy link
Member

@gfyoung gfyoung Nov 9, 2019

Choose a reason for hiding this comment

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

This wording ("stored though truncated") is a little awkward - not sure I 100% understand what this means

Copy link
Contributor Author

@hweecat hweecat Nov 10, 2019

Choose a reason for hiding this comment

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

Would the following wording be clearer in expressing the concept?

"stored in the MultiIndex levels, though the values will be truncated in the MultiIndex output."

Feel free to let me know what you think.

Copy link
Member

Choose a reason for hiding this comment

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

I think that’s a great edit - care to make that change?

@pep8speaks
Copy link

pep8speaks commented Nov 20, 2019

Hello @hweecat! 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 2020-01-02 01:51:02 UTC

@jreback jreback removed this from the 1.0 milestone Jan 1, 2020
@jreback
Copy link
Contributor

jreback commented Jan 1, 2020

can you merge master

@hweecat
Copy link
Contributor Author

hweecat commented Jan 1, 2020

@jbrockmendel I've done a "git fetch upstream" and "git merge upstream/master" - let's hope tests pass this time.

@hweecat
Copy link
Contributor Author

hweecat commented Jan 1, 2020

Okay, I have no idea what happened to my branch when I'm merging master, and tests are failing - suspect that it's caused by my previous commits made by merging master.

Anyone has any idea what to do with this?

@WillAyd
Copy link
Member

WillAyd commented Jan 1, 2020

Did you merge upstream/master or master from your branch? I'm guessing the latter given the amount of files changed

You can maybe reset hard back to before the merge and try again with upstream/master

@hweecat hweecat force-pushed the docfix-multiindex-set_levels branch from 9e205b6 to a482b78 Compare January 2, 2020 00:19
@hweecat hweecat force-pushed the docfix-multiindex-set_levels branch from a482b78 to 2a97c43 Compare January 2, 2020 01:50
@hweecat
Copy link
Contributor Author

hweecat commented Jan 2, 2020

Just checked - tests finally passed after the reset hard and merge with upstream master. Thanks for the help!

@datapythonista datapythonista merged commit b9de33e into pandas-dev:master Jan 3, 2020
@datapythonista
Copy link
Member

Thanks for the work on this @hweecat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clarify that MultiIndex.set_levels() interprets passed values as new components of the .levels attribute
7 participants