Skip to content

DOC: Clarified documentation for MultiIndexes #5964

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

felixlawrence
Copy link

Clarify some quirks regarding slicing on MultiIndexes

@felixlawrence
Copy link
Author

One of the Travis CI builds seems to have failed due to a temporary network error:
fatal: unable to connect to github.com:
github.com: Temporary failure in name resolution

Is there some way to rerun the job that failed?

@jorisvandenbossche
Copy link
Member

Regarding Travis, I don't think this is really a problem as this PR only touches documentation and no code, but if you want to retrigger Travis, you can reset the last commit and push --force again:

git commit --amend -C HEAD
git push origin yourbranch -f

But for lower levels, be aware that the MultiIndex is fundamentally a
one-dimensional object: when slicing, you are specifying a start and an end
point on a 1D array, rather than selecting a rectangular block of n-dimensional
space as done in numpy or MATLAB array slicing:
Copy link
Member

Choose a reason for hiding this comment

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

I find the "rather than selecting a rectangular block of n-dimensional space as done in numpy or MATLAB array slicing" not super clear.
The thing you want to say, is it that "slicing the (lower) levels seperately is not possible"?

@jorisvandenbossche
Copy link
Member

@felixlawrence Thanks for the PR! This is indeed an area that can use some clarification.

I just made some small comments.
And I was thinking, if you want / have the time, a small example in each docstring (from_arrays/from_tuples) would be very helpful I think. But that can also be be left for another PR.

@jreback
Copy link
Contributor

jreback commented Jan 16, 2014

@felixlawrence their is a button on the rhs of the screen for that rebuilt to rerun / cancel a build as well (relatively new feature on github)

@jorisvandenbossche
Copy link
Member

@felixlawrence +1 for the examples. Maybe still another suggestion: you could add a "See also" to each docstring referring to the other. Something like this:

See Also
--------
MultiIndex.from_tuples : Convert list of tuples to MultiIndex

And lastly, before merging, could you squash to the commits to one? See https://github.com/pydata/pandas/wiki/Using-Git#fetch-and-then-rebase-interactively-to-squash-reword-fix-otherwise-change-some-commits

Add examples and rewrite an awkwardly-written bit

Cross-reference MultiIndex constructors
@felixlawrence
Copy link
Author

I added the cross-references, committed, and squashed the commits as per the link, but couldn't push the commit up to this branch (presumably because I had squashed commits locally that are present in this remote branch). What should I do?

@hayd
Copy link
Contributor

hayd commented Jan 20, 2014

@felixlawrence you have to force push.

@jorisvandenbossche
Copy link
Member

@felixlawrence It seems it's OK now (the commit looks fine, and the travis failing is due to another issue (missing six)), so merging.

Thanks for the contribution!

jorisvandenbossche added a commit that referenced this pull request Jan 20, 2014
DOC: Clarified documentation for MultiIndexes
@jorisvandenbossche jorisvandenbossche merged commit 1e1907c into pandas-dev:master Jan 20, 2014
@felixlawrence felixlawrence deleted the improve-multiindex-docs branch January 21, 2014 10:35
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