-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Fix regression for loc and __setitem__ when one-dimensional tuple was given for MultiIndex #37787
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
Changes from 2 commits
8ccfd5a
8113cf4
5944255
3ac69ff
e3f90be
2f8c6ed
cc15da3
f8c86f5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -288,6 +288,14 @@ def convert_nested_indexer(indexer_type, keys): | |
|
||
tm.assert_series_equal(result, expected) | ||
|
||
def test_multiindex_loc_one_dimensional_tuple(self, frame_or_series): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you parameterize over all of the selectors in the OP e.g. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added tests for df, I think one of the cases mentioned there should raise and not work |
||
# GH#37711 | ||
mi = MultiIndex.from_tuples([("a", "A"), ("b", "A")]) | ||
obj = frame_or_series([1, 2], index=mi) | ||
obj.loc[("a",)] = 0 | ||
expected = frame_or_series([0, 2], index=mi) | ||
tm.assert_equal(obj, expected) | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"indexer, pos", | ||
|
Uh oh!
There was an error while loading. Please reload this page.