Skip to content

Commit 8f0d0d2

Browse files
omarafifiiluckyvs1
authored andcommitted
Added docs for the change of behavior of isin (pandas-dev#39064)
1 parent 5bd7ac2 commit 8f0d0d2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pandas/core/series.py

+9
Original file line numberDiff line numberDiff line change
@@ -4599,6 +4599,15 @@ def isin(self, values) -> Series:
45994599
4 True
46004600
5 False
46014601
Name: animal, dtype: bool
4602+
4603+
Strings and integers are distinct and are therefore not comparable:
4604+
4605+
>>> pd.Series([1]).isin(['1'])
4606+
0 False
4607+
dtype: bool
4608+
>>> pd.Series([1.1]).isin(['1.1'])
4609+
0 False
4610+
dtype: bool
46024611
"""
46034612
result = algorithms.isin(self._values, values)
46044613
return self._constructor(result, index=self.index).__finalize__(

0 commit comments

Comments
 (0)