-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: raise when wrong level name is passed to "unstack" #27631
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
dccd0b3
to
20add9f
Compare
Codecov Report
@@ Coverage Diff @@
## master #27631 +/- ##
===========================================
- Coverage 93.02% 42.41% -50.61%
===========================================
Files 182 182
Lines 50257 50259 +2
===========================================
- Hits 46750 21316 -25434
- Misses 3507 28943 +25436
Continue to review full report at Codecov.
|
20add9f
to
3a4a241
Compare
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.
LGTM. Just a comment on the whatsnew.
doc/source/whatsnew/v0.25.1.rst
Outdated
@@ -128,7 +128,7 @@ Groupby/resample/rolling | |||
Reshaping | |||
^^^^^^^^^ | |||
|
|||
- | |||
- A ``KeyError`` is now raised if ``.unstack()`` is called on a flat :class:`Index` passing a name which is not the correct one (:issue:`18303`) |
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.
"is called on a Series or DataFrame with a flat".
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.
Seems this affects both stack & unstack?
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.
"is called on a Series or DataFrame with a flat".
Fixed, thanks
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.
Seems this affects both stack & unstack?
I added tests for both, but stack
was already raising the error.
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.
Understood, thanks.
3a4a241
to
40d19a0
Compare
thanks @toobaz |
…sed to "unstack"
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff
Notice that I profited to make the error message a bit more understandable.