Skip to content

Commit 195511c

Browse files
committed
TEST: Test Index.any/all compat with numpy
1 parent cdce525 commit 195511c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pandas/tests/reductions/test_reductions.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,14 @@ def test_min_max_categorical(self):
550550
assert ci.min() == "c"
551551
assert ci.max() == "b"
552552

553+
@pytest.mark.parametrize("op", ["any", "all"])
554+
def test_numpy_any_all(self, op):
555+
idx = Index([0, 1, 2])
556+
assert not np.all(idx)
557+
assert np.any(idx)
558+
idx = Index([1, 2, 3])
559+
assert np.all(idx)
560+
553561

554562
class TestSeriesReductions:
555563
# Note: the name TestSeriesReductions indicates these tests

0 commit comments

Comments
 (0)