-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: fix isin with Series of tuples values (#16394) #16434
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
db346e3
4d192a0
1a98fdc
4dc6bc5
e71219d
ce622e6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1201,6 +1201,13 @@ def test_isin_df(self): | |
expected['B'] = False | ||
tm.assert_frame_equal(result, expected) | ||
|
||
def test_isin_tuples(self): | ||
df = pd.DataFrame({'A': [1, 2, 3], 'B': ['a', 'b', 'f']}) | ||
df['C'] = list(zip(df['A'], df['B'])) | ||
result = df['C'].isin([(1, 'a')]) | ||
tm.assert_series_equal(result, | ||
Series([True,False,False],name="C")) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. for PEP8: the indentation does not fully match with the line before (one space more needed), and a space after the comma is needed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry about that, fixed |
||
|
||
def test_isin_df_dupe_values(self): | ||
df1 = DataFrame({'A': [1, 2, 3, 4], 'B': [2, np.nan, 4, 4]}) | ||
# just cols duped | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add the original issue number as a comment on the first line ?
just like
# GH16394
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed