Reputation: 123
import pandas as pd
a = pd.Series('1')
b = pd.Series(1)
a.isin(b)
0 False
dtype: bool
b.isin(a)
0 True
dtype: bool
Upvotes: 5
Views: 336
Reputation: 16683
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.
Upvotes: 3