File tree 2 files changed +15
-2
lines changed
2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -70,9 +70,9 @@ def _ensure_data(values, dtype=None):
70
70
# we are actually coercing to uint64
71
71
# until our algos support uint8 directly (see TODO)
72
72
return np .asarray (values ).astype ('uint64' ), 'bool' , 'uint64'
73
- elif is_signed_integer_dtype (values ) or is_signed_integer_dtype (dtype ):
73
+ elif is_signed_integer_dtype (values ) and is_signed_integer_dtype (dtype ):
74
74
return _ensure_int64 (values ), 'int64' , 'int64'
75
- elif (is_unsigned_integer_dtype (values ) or
75
+ elif (is_unsigned_integer_dtype (values ) and
76
76
is_unsigned_integer_dtype (dtype )):
77
77
return _ensure_uint64 (values ), 'uint64' , 'uint64'
78
78
elif is_float_dtype (values ) or is_float_dtype (dtype ):
Original file line number Diff line number Diff line change @@ -555,6 +555,19 @@ def test_empty(self, empty):
555
555
result = algos .isin (vals , empty )
556
556
tm .assert_numpy_array_equal (expected , result )
557
557
558
+ def test_regression_issue_19356 (self ):
559
+ # Regression test for GH19356
560
+ l = [- 9 , - 0.5 ]
561
+ expected = np .array ([True , False ])
562
+
563
+ series_float = pd .Series ([- 9.0 , 0.0 ])
564
+ result_float = series_float .isin (l )
565
+ tm .assert_numpy_array_equal (expected , result_float .values )
566
+
567
+ series_int = pd .Series ([- 9 , 0 ])
568
+ result_int = series_int .isin (l )
569
+ tm .assert_numpy_array_equal (expected , result_int .values )
570
+
558
571
559
572
class TestValueCounts (object ):
560
573
You can’t perform that action at this time.
0 commit comments