-
Notifications
You must be signed in to change notification settings - Fork 51
feat: Add __contains__
to Index, Series, DataFrame
#1899
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
Conversation
bf_result = scalars_df_index.set_index(col_name).index.__contains__(key) | ||
pd_result = scalars_pandas_df_index.set_index(col_name).index.__contains__(key) | ||
assert bf_result == pd_result |
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.
nit: Let's use key in abc.index
for testing instead.
Also empty lines before assertions ;-)
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
tests/system/small/test_dataframe.py
Outdated
bf_result = scalars_df_index.__contains__(key) | ||
pd_result = scalars_pandas_df_index.__contains__(key) | ||
assert bf_result == pd_result |
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.
Shall we update these too?
tests/system/small/test_series.py
Outdated
bf_result = scalars_df_index["int64_col"].__contains__(key) | ||
pd_result = scalars_pandas_df_index["int64_col"].__contains__(key) | ||
assert bf_result == pd_result |
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.
Shall we update these lines too?
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.
ahh, missed that one, fixed
__contains__
to Index, Series, DataFrame
BEGIN_COMMIT_OVERRIDE
feat: Add
__contains__
to Index, Series, DataFrame (#1899)END_COMMIT_OVERRIDE
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes #<issue_number_goes_here> 🦕