Skip to content

ENH: support Index.any/all with float, timedelta64 dtypes #54566

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

Merged
merged 6 commits into from
Aug 22, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update test
  • Loading branch information
jbrockmendel committed Aug 21, 2023
commit d37bcdc6cdbd710ea4a51cb3620213fba3bd0f0d
8 changes: 6 additions & 2 deletions pandas/tests/indexes/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -692,8 +692,12 @@ def test_format_missing(self, vals, nulls_fixture):
@pytest.mark.parametrize("op", ["any", "all"])
def test_logical_compat(self, op, simple_index):
index = simple_index
assert getattr(index, op)() == getattr(index.values, op)()
assert getattr(index, op)() == getattr(index.to_series(), op)()
left = getattr(index, op)()
assert left == getattr(index.values, op)()
right = getattr(index.to_series(), op)()
# left might not match right exactly in e.g. string cases where the
# because we use np.any/all instead of .any/all
assert bool(left) == bool(right)

@pytest.mark.parametrize(
"index", ["string", "int64", "int32", "float64", "float32"], indirect=True
Expand Down