Skip to content

Commit 62bb43d

Browse files
committed
TST: add test for multiple element Float64Index containment
1 parent 59110fd commit 62bb43d

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

pandas/tests/test_index.py

+13
Original file line numberDiff line numberDiff line change
@@ -919,6 +919,19 @@ def test_doesnt_contain_all_the_things(self):
919919
self.assertFalse(i.isin([1]).item())
920920
self.assertTrue(i.isin([np.nan]).item())
921921

922+
def test_nan_multiple_containment(self):
923+
i = Float64Index([1.0, np.nan])
924+
np.testing.assert_array_equal(i.isin([1.0]), np.array([True, False]))
925+
np.testing.assert_array_equal(i.isin([2.0, np.pi]),
926+
np.array([False, False]))
927+
np.testing.assert_array_equal(i.isin([np.nan]),
928+
np.array([False, True]))
929+
np.testing.assert_array_equal(i.isin([1.0, np.nan]),
930+
np.array([True, True]))
931+
i = Float64Index([1.0, 2.0])
932+
np.testing.assert_array_equal(i.isin([np.nan]),
933+
np.array([False, False]))
934+
922935

923936
class TestInt64Index(tm.TestCase):
924937
_multiprocess_can_split_ = True

0 commit comments

Comments
 (0)