Skip to content

Commit c540fe8

Browse files
committed
test series.isin
1 parent 1c1a668 commit c540fe8

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pandas/tests/test_algos.py

+10
Original file line numberDiff line numberDiff line change
@@ -840,13 +840,23 @@ def test_same_nan_is_in(self):
840840
result = algos.isin(comps, values)
841841
tm.assert_numpy_array_equal(expected, result)
842842

843+
# issue:`22205`
843844
def test_same_nan_is_in_large(self):
844845
s = np.tile(1.0, 1_000_001)
845846
s[0] = np.nan
846847
result = algos.isin(s, [np.nan, 1])
847848
expected = np.ones(len(s), dtype=bool)
848849
tm.assert_numpy_array_equal(result, expected)
849850

851+
# issue:`#25395`
852+
def test_same_nan_is_in_large_series(self):
853+
s = np.tile(1.0, 1_000_001)
854+
series = pd.Series(s)
855+
s[0] = np.nan
856+
result = series.isin([np.nan, 1])
857+
expected = pd.Series(np.ones(len(s), dtype=bool))
858+
tm.assert_series_equal(result, expected)
859+
850860
def test_same_object_is_in(self):
851861
# GH 22160
852862
# there could be special treatment for nans

0 commit comments

Comments
 (0)