The Python Oracle

Is Series.isin() inconsistent for 'str' and 'int' type values?

--------------------------------------------------
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------

Music by Eric Matyas
https://www.soundimage.org
Track title: The Builders

--

Chapters
00:00 Is Series.Isin() Inconsistent For 'Str' And 'Int' Type Values?
00:20 Accepted Answer Score 3
00:37 Thank you

--

Full question
https://stackoverflow.com/questions/6068...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #pandas

#avk47



ACCEPTED ANSWER

Score 3


It looks like there is a similar open issue for .isin() called Pandas doesn't always cast strings to int consistently when using .isin(): https://github.com/pandas-dev/pandas/issues/24918

The issue was opened and last commented on in January 2019.