-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
REGR: Setting values with 'loc' and boolean mask mixes up values (all-True mask) #48701
Comments
I believe that this is a regression in pandas 1.5.0 as this works correctly on 1.4.4. We ran into the same bug in downstream yesterday geopandas/geopandas#2558. |
The reproducer from that issue:
It indeed needs some minimum values, because of
This argsort is used here: pandas/pandas/core/indexing.py Line 1990 in 71fc89c
That code assumes that indexer is already an integer indexer, not a boolean one. Before, we converted a boolean indexer to integers in I haven't verified to be 100% sure, but so given the code path and the change in #45501, I assume that's the cause. |
yup, git bisect confirms |
According to documentation, using
loc
should work with Boolean arrays. However, the following does not seem to work:The weird thing is that if n is smaller then the code works. This has been tested on Pandas 1.5.0
The text was updated successfully, but these errors were encountered: