-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
BUG: do not fail when stack()ing unsortable level #18363
Conversation
Codecov Report
@@ Coverage Diff @@
## master #18363 +/- ##
==========================================
- Coverage 91.38% 91.36% -0.03%
==========================================
Files 164 164
Lines 49790 49790
==========================================
- Hits 45501 45490 -11
- Misses 4289 4300 +11
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #18363 +/- ##
==========================================
- Coverage 91.38% 91.36% -0.03%
==========================================
Files 164 164
Lines 49790 49790
==========================================
- Hits 45501 45490 -11
- Misses 4289 4300 +11
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #18363 +/- ##
==========================================
- Coverage 91.38% 91.33% -0.05%
==========================================
Files 164 164
Lines 49790 49790
==========================================
- Hits 45501 45478 -23
- Misses 4289 4312 +23
Continue to review full report at Codecov.
|
pandas/tests/frame/test_reshape.py
Outdated
def test_stack_mixed_level(self): | ||
# GH 18310 | ||
levels = [range(3), [3, 'a'], [1, 2]] | ||
# flat columns: |
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.
blank line here
# MultiIndex columns: | ||
df = DataFrame(1, index=levels[0], | ||
columns=MultiIndex.from_product(levels[1:])) | ||
result = df.stack(1) |
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.
can you add the 2nd example you had in the issue as well, e.g. df[['a', 'b']].stack(0)
(though different starting frame as well i think.
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.
(done)
ping
c0a6136
to
6d267a2
Compare
@jreback are you waiting for any action from me on this one? |
nope! |
git diff upstream/master -u -- "*.py" | flake8 --diff