File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -550,13 +550,6 @@ def test_min_max_categorical(self):
550550 assert ci .min () == "c"
551551 assert ci .max () == "b"
552552
553- def test_numpy_any_all (self ):
554- idx = Index ([0 , 1 , 2 ])
555- assert not np .all (idx )
556- assert np .any (idx )
557- idx = Index ([1 , 2 , 3 ])
558- assert np .all (idx )
559-
560553
561554class TestSeriesReductions :
562555 # Note: the name TestSeriesReductions indicates these tests
@@ -905,6 +898,15 @@ def test_all_any(self):
905898 s = Series (["abc" , True ])
906899 assert "abc" == s .any () # 'abc' || True => 'abc'
907900
901+ @pytest .mark .parametrize ("klass" , [Index , Series ])
902+ def test_numpy_all_any (self , klass ):
903+ # GH#40180
904+ idx = klass ([0 , 1 , 2 ])
905+ assert not np .all (idx )
906+ assert np .any (idx )
907+ idx = Index ([1 , 2 , 3 ])
908+ assert np .all (idx )
909+
908910 def test_all_any_params (self ):
909911 # Check skipna, with implicit 'object' dtype.
910912 s1 = Series ([np .nan , True ])
You can’t perform that action at this time.
0 commit comments