From 4d134b066050d54b7d78a7c200dabe01345a259f Mon Sep 17 00:00:00 2001 From: Omar Afifi Date: Sun, 17 Jan 2021 17:36:01 +0200 Subject: [PATCH] Backport PR #39064: Added docs for the change of behavior of isin --- pandas/core/series.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pandas/core/series.py b/pandas/core/series.py index 1449b78ee91d8..b4e8696ad9e13 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -4622,6 +4622,15 @@ def isin(self, values) -> "Series": 4 True 5 False Name: animal, dtype: bool + + Strings and integers are distinct and are therefore not comparable: + + >>> pd.Series([1]).isin(['1']) + 0 False + dtype: bool + >>> pd.Series([1.1]).isin(['1.1']) + 0 False + dtype: bool """ result = algorithms.isin(self._values, values) return self._constructor(result, index=self.index).__finalize__(