-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Regression in loc.setitem raising ValueError with unordered MultiIndex columns and scalar indexer #39071
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
…x columns and scalar indexer
@@ -1685,6 +1685,15 @@ def test_getitem_interval_index_partial_indexing(self): | |||
res = df.loc[:, 0.5] | |||
tm.assert_series_equal(res, expected) | |||
|
|||
@pytest.mark.parametrize("indexer", ["A", ["A"]]) |
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 other 3 cases from OP that 'work fine' (2 x slice and a sorted case). ok to have another test if helpful.
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, worked through parametrization
I think you're right, yes |
Changed it then |
lgtm. will merge / backport on green. |
Merged master again to fix benchmarks, will ping on green |
@jreback green |
this @phofl |
@meeseeksdev backport 1.2.x |
…Error with unordered MultiIndex columns and scalar indexer
… unordered MultiIndex columns and scalar indexer (#39084) Co-authored-by: patrick <[email protected]>
|
Interesting, but should not matter? |
I don't think this makes a difference, we are always looping over the result as far as I can see. |
…x columns and scalar indexer (pandas-dev#39071) * Regression in loc.setitem raising ValueError with unordered MultiIndex columns and scalar indexer * Add tests * Improve performance
@jbrockmendel Would it be faster to use arange too in the line above of my fix instead of Index?