File tree 1 file changed +4
-9
lines changed
1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -648,25 +648,20 @@ def __hash__(self):
648
648
649
649
def test_different_nans (self ):
650
650
# GH 22160
651
- # the current behavior is:
652
- # * list, array of objects: isin() is False for different nan-objects
653
- # * array of float64s: isin() is True for all nans
654
- # this behavior might be changed in the future
655
- #
656
- # this test case only ensures it doesn't happen accidentally
657
- #
651
+ # all nans are handled as equivalent
652
+
658
653
comps = [float ('nan' )]
659
654
values = [float ('nan' )]
660
655
assert comps [0 ] is not values [0 ] # different nan-objects
661
656
662
657
# as list of python-objects:
663
658
result = algos .isin (comps , values )
664
- tm .assert_numpy_array_equal (np .array ([False ]), result )
659
+ tm .assert_numpy_array_equal (np .array ([True ]), result )
665
660
666
661
# as object-array:
667
662
result = algos .isin (np .asarray (comps , dtype = np .object ),
668
663
np .asarray (values , dtype = np .object ))
669
- tm .assert_numpy_array_equal (np .array ([False ]), result )
664
+ tm .assert_numpy_array_equal (np .array ([True ]), result )
670
665
671
666
# as float64-array:
672
667
result = algos .isin (np .asarray (comps , dtype = np .float64 ),
You can’t perform that action at this time.
0 commit comments