-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
DEPR: loc with listlikes with missing elements #29802
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
91dd7d4
1ecab6c
aa31455
730f710
dec0eba
730d2a4
e136a93
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 |
---|---|---|
|
@@ -750,20 +750,9 @@ def test_iloc_non_unique_indexing(self): | |
df2 = DataFrame({"A": [0.1] * 1000, "B": [1] * 1000}) | ||
df2 = concat([df2, 2 * df2, 3 * df2]) | ||
|
||
sidx = df2.index.to_series() | ||
expected = df2.iloc[idx[idx <= sidx.max()]] | ||
|
||
new_list = [] | ||
for r, s in expected.iterrows(): | ||
new_list.append(s) | ||
new_list.append(s * 2) | ||
new_list.append(s * 3) | ||
|
||
expected = DataFrame(new_list) | ||
expected = concat([expected, DataFrame(index=idx[idx > sidx.max()])], sort=True) | ||
with tm.assert_produces_warning(FutureWarning, check_stacklevel=False): | ||
result = df2.loc[idx] | ||
tm.assert_frame_equal(result, expected, check_index_type=False) | ||
with pytest.raises(KeyError, match="with any missing labels"): | ||
# TODO: should non-uniquness play a part in the error message? | ||
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. hmm, yes I would agree 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. sounds good, ill see what i can do here. BTW in #6581 are we removing things in the 0.25.0 section or only the earlier ones? 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. hmm the non-uniqueness doesn't seem to play any part in us getting here, so im now leaning towards not having a special message |
||
df2.loc[idx] | ||
|
||
def test_iloc_empty_list_indexer_is_ok(self): | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.