Skip to content

Commit f11b14a

Browse files
committed
pandas-dev#22207 changed the behavior with different nan-objecst, thus adjusting the test cases
1 parent 5c0ecc1 commit f11b14a

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

pandas/tests/test_algos.py

+4-9
Original file line numberDiff line numberDiff line change
@@ -648,25 +648,20 @@ def __hash__(self):
648648

649649
def test_different_nans(self):
650650
# 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+
658653
comps = [float('nan')]
659654
values = [float('nan')]
660655
assert comps[0] is not values[0] # different nan-objects
661656

662657
# as list of python-objects:
663658
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)
665660

666661
# as object-array:
667662
result = algos.isin(np.asarray(comps, dtype=np.object),
668663
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)
670665

671666
# as float64-array:
672667
result = algos.isin(np.asarray(comps, dtype=np.float64),

0 commit comments

Comments
 (0)