Skip to content

Commit f3476a4

Browse files
phoflluckyvs1
authored andcommitted
TST: Isin converted floats unnecessarily to int causing rounding issues (pandas-dev#37770)
1 parent 34e4aea commit f3476a4

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pandas/tests/series/methods/test_isin.py

+8
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,14 @@ def test_isin_period_freq_mismatch(self):
145145
res = pd.core.algorithms.isin(ser, other)
146146
tm.assert_numpy_array_equal(res, expected)
147147

148+
@pytest.mark.parametrize("values", [[-9.0, 0.0], [-9, 0]])
149+
def test_isin_float_in_int_series(self, values):
150+
# GH#19356 GH#21804
151+
ser = Series(values)
152+
result = ser.isin([-9, -0.5])
153+
expected = Series([True, False])
154+
tm.assert_series_equal(result, expected)
155+
148156

149157
@pytest.mark.slow
150158
def test_isin_large_series_mixed_dtypes_and_nan():

0 commit comments

Comments
 (0)