Skip to content
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

ENH: Support Series[bool] as indexer for iloc.__getitem__ #61162

Merged
merged 11 commits into from
Apr 9, 2025
Prev Previous commit
Next Next commit
formatting
  • Loading branch information
arthurlw committed Mar 29, 2025
commit 7533f64dfad439b256714c56203c8031e96cc02f
7 changes: 2 additions & 5 deletions pandas/tests/indexing/test_iloc.py
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ def test_iloc_mask(self):
for idx in [None, "index", "locs"]:
mask = (df.nums > 2).values
if idx:
mask_index = getattr(df, idx if idx == "index" else "locs")[::-1]
mask_index = getattr(df, idx)[::-1]
mask = Series(mask, list(mask_index))
for method in ["", ".loc", ".iloc"]:
try:
Expand All @@ -779,10 +779,7 @@ def test_iloc_mask(self):
else:
accessor = df
answer = str(bin(accessor[mask]["nums"].sum()))
except (
ValueError,
IndexingError,
) as err:
except (ValueError, IndexingError) as err:
answer = str(err)

key = (
Expand Down
Loading