@@ -2374,3 +2374,30 @@ def test_index(self):
23742374 dtype = "timedelta64[ns]" ,
23752375 )
23762376 tm .assert_series_equal (algos .mode (idx ), exp )
2377+
2378+ @pytest .mark .xfail (reason = "problem related with issue #34125" )
2379+ def test_isin_int_df_string_search (self ):
2380+ """Comparing df with int`s (1,2) with a string at isin() ("1")
2381+ -> should not match values because int 1 is not equal str 1"""
2382+ df = pd .DataFrame ({"values" : [1 , 2 ]})
2383+ result = df .isin (["1" ])
2384+ expected_false = pd .DataFrame ({"values" : [False , False ]})
2385+ tm .assert_frame_equal (result , expected_false )
2386+
2387+ @pytest .mark .xfail (reason = "problem related with issue #34125" )
2388+ def test_isin_nan_df_string_search (self ):
2389+ """Comparing df with nan value (np.nan,2) with a string at isin() ("NaN")
2390+ -> should not match values because np.nan is not equal str NaN """
2391+ df = DataFrame ({"values" : [np .nan , 2 ]})
2392+ result = df .isin (["NaN" ])
2393+ expected_false = pd .DataFrame ({"values" : [False , False ]})
2394+ tm .assert_frame_equal (result , expected_false )
2395+
2396+ @pytest .mark .xfail (reason = "problem related with issue #34125" )
2397+ def test_isin_float_df_string_search (self ):
2398+ """Comparing df with floats (1.4245,2.32441) with a string at isin() ("1.4245")
2399+ -> should not match values because float 1.4245 is not equal str 1.4245"""
2400+ df = DataFrame ({"values" : [1.4245 , 2.32441 ]})
2401+ result = df .isin (["1.4245" ])
2402+ expected_false = pd .DataFrame ({"values" : [False , False ]})
2403+ tm .assert_frame_equal (result , expected_false )
0 commit comments