Skip to content

Commit e0243ee

Browse files
Backport PR #39064: Added docs for the change of behavior of isin (#39230)
Co-authored-by: Omar Afifi <[email protected]>
1 parent 9b47cb9 commit e0243ee

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pandas/core/series.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4622,6 +4622,15 @@ def isin(self, values) -> "Series":
46224622
4 True
46234623
5 False
46244624
Name: animal, dtype: bool
4625+
4626+
Strings and integers are distinct and are therefore not comparable:
4627+
4628+
>>> pd.Series([1]).isin(['1'])
4629+
0 False
4630+
dtype: bool
4631+
>>> pd.Series([1.1]).isin(['1.1'])
4632+
0 False
4633+
dtype: bool
46254634
"""
46264635
result = algorithms.isin(self._values, values)
46274636
return self._constructor(result, index=self.index).__finalize__(

0 commit comments

Comments
 (0)