BUG #16012 - fix isin for large object arrays · rs2/pandas@186607b (original) (raw)

`@@ -1092,6 +1092,15 @@ def test_isin(self):

`

1092

1092

`expected = Series([True, False, True, False, False, False, True, True])

`

1093

1093

`assert_series_equal(result, expected)

`

1094

1094

``

``

1095

`+

GH: 16012

`

``

1096

`+

This specific issue has to have a series over 1e6 in len, but the

`

``

1097

`+

comparison array (in_list) must be large enough so that numpy doesn't

`

``

1098

`+

do a manual masking trick that will avoid this issue altogether

`

``

1099

`+

s = Series(list('abcdefghijk' * 10 ** 5))

`

``

1100

`+

in_list = [-1, 'a', 'b', 'G', 'Y', 'Z', 'E', 'K', 'E', 'S', 'I', 'R', 'R']*6

`

``

1101

+

``

1102

`+

assert s.isin(in_list).sum() == 200000

`

``

1103

+

1095

1104

`def test_isin_with_string_scalar(self):

`

1096

1105

`# GH4763

`

1097

1106

`s = Series(['A', 'B', 'C', 'a', 'B', 'B', 'A', 'C'])

`