-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
ENH: Index[bool] #45061
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
ENH: Index[bool] #45061
Conversation
jbrockmendel
commented
Dec 24, 2021
•
edited
Loading
edited
- closes API: support a BooleanIndex #15890
- tests added / passed
- Ensure all linting tests pass, see here for how to run them
- whatsnew entry
50a005c
to
5142a2d
Compare
i think it might be ok to actually just change this, are you finding that you need to change test behavior? |
Yes. Largely around factorize and value_counts where this branch is currently very ad-hoc. |
looks ok for 1.4? |
I'd rather not rush it. |
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.
minor comment. ready to go?
@@ -54,7 +54,9 @@ def test_drop_with_ignore_errors(): | |||
|
|||
# GH 8522 | |||
ser = Series([2, 3], index=[True, False]) | |||
assert ser.index.is_object() | |||
ser = Series([2, 3], index=[True, False]) |
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.
duplicate line here
just pushed with a fix. i think ready, yes. |
can you rebase again (as the scipy fix merged) |
thanks @jbrockmendel very nice! |
There was pandas bug enhancement (pandas-dev/pandas#45061), that includes the possibility of a boolean Index. In dask operations that involve `/` or `truediv` (see comment #8722 (comment)) returns a dataframe with an object-dtyped index instead. This PR includes includes the `idx.dtype` when registering the meta for the case of `pd.Index`