@@ -944,6 +944,33 @@ def test_different_nans_as_float64(self):
944
944
expected = np .array ([True , True ])
945
945
tm .assert_numpy_array_equal (result , expected )
946
946
947
+ @pytest .mark .xfail (reason = "problem related with issue #34125" )
948
+ def test_isin_int_df_string_search (self ):
949
+ """Comparing df with int`s (1,2) with a string at isin() ("1")
950
+ -> should not match values because int 1 is not equal str 1"""
951
+ df = pd .DataFrame ({"values" : [1 , 2 ]})
952
+ result = df .isin (["1" ])
953
+ expected_false = pd .DataFrame ({"values" : [False , False ]})
954
+ tm .assert_frame_equal (result , expected_false )
955
+
956
+ @pytest .mark .xfail (reason = "problem related with issue #34125" )
957
+ def test_isin_nan_df_string_search (self ):
958
+ """Comparing df with nan value (np.nan,2) with a string at isin() ("NaN")
959
+ -> should not match values because np.nan is not equal str NaN """
960
+ df = pd .DataFrame ({"values" : [np .nan , 2 ]})
961
+ result = df .isin (["NaN" ])
962
+ expected_false = pd .DataFrame ({"values" : [False , False ]})
963
+ tm .assert_frame_equal (result , expected_false )
964
+
965
+ @pytest .mark .xfail (reason = "problem related with issue #34125" )
966
+ def test_isin_float_df_string_search (self ):
967
+ """Comparing df with floats (1.4245,2.32441) with a string at isin() ("1.4245")
968
+ -> should not match values because float 1.4245 is not equal str 1.4245"""
969
+ df = pd .DataFrame ({"values" : [1.4245 , 2.32441 ]})
970
+ result = df .isin (["1.4245" ])
971
+ expected_false = pd .DataFrame ({"values" : [False , False ]})
972
+ tm .assert_frame_equal (result , expected_false )
973
+
947
974
948
975
class TestValueCounts :
949
976
def test_value_counts (self ):
0 commit comments