-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Labels
DocsDtype ConversionsUnexpected or buggy dtype conversionsUnexpected or buggy dtype conversionsTestingpandas testing functions or related to the test suitepandas testing functions or related to the test suitegood first issue
Milestone
Description
Location of the documentation
https://pandas.pydata.org/docs/whatsnew/v1.2.0.html
Documentation problem
There seems to be an undocumented change with how isin
works.
pandas 1.1.5:
import pandas as pd
pd.Series([0]).isin(['0'])
# 0 True
# dtype: bool
pd.Series([1]).isin(['1'])
# 0 True
# dtype: bool
pd.Series([1.1]).isin(['1.1'])
# 0 True
# dtype: bool
But in pandas 1.2.0 (and 1.2.0rc):
import pandas as pd
pd.Series([0]).isin(['0'])
# 0 False
# dtype: bool
pd.Series([1]).isin(['1'])
# 0 False
# dtype: bool
pd.Series([1.1]).isin(['1.1'])
# 0 False
# dtype: bool
But the release notes mentions nothing about it.
I have not posted this issue as an bug, because I think the newer implementation is the better implementation.
However I propose adding the change to the release notes for other people like me where the change broke tests in a pipeline.
Suggested fix for documentation
Add a line mentioning that isin
no longer returns true when comparing floats to a string of the float.
Metadata
Metadata
Assignees
Labels
DocsDtype ConversionsUnexpected or buggy dtype conversionsUnexpected or buggy dtype conversionsTestingpandas testing functions or related to the test suitepandas testing functions or related to the test suitegood first issue