Skip to content

Commit 4d134b0

Browse files
omarafifiimeeseeksmachine
authored andcommitted
Backport PR pandas-dev#39064: Added docs for the change of behavior of isin
1 parent 9b47cb9 commit 4d134b0

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
@@ -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)