-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
Fix MultiIndex .loc "Too Many Indexers" with None as return value #34450
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 3 commits
0c02a7f
2db8090
537fc45
8a540ff
6cab469
25800c6
0bc5844
553a879
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 |
---|---|---|
|
@@ -853,6 +853,17 @@ def test_setitem_slice_into_readonly_backing_data(): | |
assert not array.any() | ||
|
||
|
||
def test_access_none_value_in_multiindex(): | ||
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 make a new file in this dir: test_multiindex.py we have the MI tests elsewhere so ok starting a new file here. 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. should I copy all the imports from test_indexing.py? 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. you need whatever imports make flake happy :-> |
||
# GH34318: test that you can access a None value using .loc through a Multiindex | ||
|
||
expected = None | ||
result = pd.Series([None], pd.MultiIndex.from_arrays([["Level1"], ["Level2"]])).loc[ | ||
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 write this in a more readable way
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. pls add all the examples here as well: #34318 (comment) |
||
("Level1", "Level2") | ||
] | ||
|
||
assert expected == result | ||
|
||
|
||
""" | ||
miscellaneous methods | ||
""" | ||
|
Uh oh!
There was an error while loading. Please reload this page.