-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: indexing with boolean array and categoricals #12861
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
Comments
I have been looking into this bug, and I found a change I could make in internals.py that did not raise any Value Errors and appeared to slice as expected; but I am not sure this is the safest change to make. The change I made resulted from me noticing that the transpose of each block within block manager did not seem to return the proper dimensions that would be expected from the boolean conditional dataframe. Heres what I did:
Now this did not solve the issue completely because I have found some additional bugs with the category dataframe keeping its format as category and not an object:First note the following, using the changes above, and performing the following:
I have followed this bug into the following location: expressions.py/_where_standard()
If "a" is a category, then after performing this function, the result is converted to an object. Second, I have noticed a similar bug when performing a transpose on categorical data (results are returned as objects):
|
Pretty difficult to see the buggy behavior without the original dataframe so closing but can reopen at a later date |
xref #12857
after #12564, the boolean array is ok
but indexing is broken
The text was updated successfully, but these errors were encountered: