-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
BUG: Boolean indexing on an empty series loses index names #4236
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
can u put tests in to check the resulting dtype |
Added a check on dtype. |
@jreback this looks reasonable to me. Think it's a bug fix rather than API change. @mtkni Do you mind adding a Note in the release notes ( |
I think this might be fixed |
The first test is already working in master, names propagate (however can't hurt to add test?). This one isn't though:
I get (in master):
maybe @mtkni has some thoughts. |
actually the inference of 'empty' I don't think is actually used anywhere. I would ALWAYS return the type (and mixed) if you fall thru the loop, empty is definitly weird |
if n == 0, then just return an inferred dtype (you have to map them, prob via the kind) e.g.
|
@jreback well apparently not, since moving just those 3 lines seems to do the trick. merge then? |
@hayd ok then! |
This passes on a rebase https://travis-ci.org/hayd/pandas/builds/10534501 @jreback Will wait on release note? Or I could pop it in to my branch. |
@hayd whatever works for you! |
ok, adding commit to my rebased branch and will close these. |
#4235