-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: Do not allow boolean values for indexing with .loc without a boolean index. #40726
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
Apr 1, 2021
•
edited
Loading
edited
- closes BUG: DataFrame/Series.loc improperly allows lookups of boolean labels/slices #20432
- tests added / passed
- Ensure all linting tests pass, see here for how to run them
- whatsnew entry
Please add whatsnew |
Added. |
CI failure seems related |
Yes, indeed. I could fix most of the failing tests with specifying the dtypes. But for some reason specifying dtype="boolean" does not remove the warning. This is a separate issue though. |
788209c
to
7f35cf8
Compare
I must have been tired. dtype="boolean" was not passed to the df or series, but to the index. Fixed and expect CI to be green. |
Small comments, otherwise lgtm, pls merge master too |
Hello @DriesSchaumont! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found: There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2021-04-06 15:29:28 UTC |
9b402bb
to
13bc416
Compare
lgtm cc @jreback @jbrockmendel |
@DriesSchaumont did you post the updated asv's? |
Here |
@phofl pls merge! |
thanks @DriesSchaumont |
…lean index. (pandas-dev#40726) * Add boolean loc tests. * BUG: Raise TypeError when using boolean indexer with loc. * Fix styling issues. * Adjustments for review. * Add whatsnew entry. * Switch boolean statements. * Switch to KeyError. * Switch to KeyError pt.2 * Remove stray dot in whatsnew * Fix DeprecationWarning. * Fix DeprecationWarning pt.2 * Adjustments to comments. * Adjustments to comments pt. 2.