@@ -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 ):
@@ -2374,30 +2401,3 @@ def test_index(self):
2374
2401
dtype = "timedelta64[ns]" ,
2375
2402
)
2376
2403
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 = pd .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 = pd .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