-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: Using boolean keys to select a column (GH44322) #44425
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
DriesSchaumont
commented
Nov 13, 2021
•
edited
Loading
edited
- closes BUG: can't select single column from DataFrame by boolean key #44322
- tests added / passed
- Ensure all linting tests pass, see here for how to run them
- whatsnew entry
9c9f8fa
to
746a109
Compare
pandas/tests/indexing/test_loc.py
Outdated
@@ -178,6 +178,13 @@ def test_column_types_consistent(self): | |||
) | |||
tm.assert_frame_equal(df, expected) | |||
|
|||
def test_loc_getitem_column_boolean_arg(self): |
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 all of the examples from the OP (working & not-working), parameterizing if appropriate
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.
Done. Added isinstance
check because tm.assert_equal
raises NotImplementedError
for scalars.
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.
lgtm apart from @jreback's comment
thanks @DriesSchaumont |