-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
DOC: add documentation to IndexSlice #15623
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
Conversation
jdcla
commented
Mar 8, 2017
•
edited by jorisvandenbossche
Loading
edited by jorisvandenbossche
- closes DOC: add IndexSlice docstring + add to api docs #12508
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice docstring!
You have a few PEP8 / style related issues. We test for this on travis (the third failing build has the output of those tests):
pandas/core/indexing.py:52:80: E501 line too long (81 > 79 characters)
pandas/core/indexing.py:59:51: W291 trailing whitespace
pandas/core/indexing.py:76:1: W293 blank line contains whitespace
But it is best that you configure your editor to automatically remove trailing whitespace on save (to prevent that you have to fix this manually). And you can always check this locally with git diff master | flake8 --diff
(if you have flake8
installed, see http://pandas.pydata.org/pandas-docs/stable/contributing.html#code-standards)
pandas/core/indexing.py
Outdated
Examples | ||
-------- | ||
|
||
>>> miindex = pd.MultiIndex.from_product([['A0','A1'],['B0','B1','B2','B3']]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is too long. But you can rename the miindex
to eg midx
, then it should fit :-)
pandas/core/indexing.py
Outdated
Using the IndexSlice class for a more intuitive command: | ||
|
||
>>> idx = pd.IndexSlice | ||
>>> dfmi.loc[idx[:,['B0','B1']],:] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be fully equivalent to the one above, the ['B0','B1']
should be 'B0':'B1'
I think
Codecov Report
@@ Coverage Diff @@
## master #15623 +/- ##
==========================================
- Coverage 91.01% 91% -0.02%
==========================================
Files 143 143
Lines 49301 49301
==========================================
- Hits 44873 44864 -9
- Misses 4428 4437 +9
Continue to review full report at Codecov.
|
OK, travis is happy now with regard to PEP8, merging then. @jimclauwaert Thanks! |