-
-
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
BUG: partial boolean indexing fails with dtype = int #2746
Comments
@stephenwlin we didn't close this for some reason....any thoughts? |
ok i can take a look |
@jreback I thought about this and there's probably a one or two line fix that can handle this particular case...but I think the most general solution here might be to implement a function called This would probably be useful in a lot of other places where similar unifications are required, like joins or sets (I think a lot of this logic is duplicated in different places right now and not complete either, mostly only handling ints and floats cases). For example, I'm fairly sure that right now, (Possibly The one thing I can think of that might be kind of tricky would be the case of datetime64[ns]: right now, they don't upcast correctly to objects, so you can't unify them with other types: instead, you want to allow other objects (like dates, string, etc.) to implicit cast to datetime64[ns] on assignment, if possible, as well as convert NaN to NaT. This is currently handled as a special case in What do you think? Overkill? |
(On second thought, might not be worth it to handle the >2 dtypes case...I don't think it happens anywhere practically) |
I tried to fix this, and my solution would work, but have to change the data and dtype of a series inplace is currently not possible, in np 1.7 would work though http://docs.scipy.org/doc/numpy/reference/generated/numpy.copyto.html#numpy.copyto (once series is refactored to have a _data as its internals, then this is easy) |
got it....in place updating
|
BUG: in-place conversion of integer series to float (on putmasking), GH #2746.
this fails because we are putmasking on a dtype=int ndarray
need to cast if this is the case (in series.where)
The text was updated successfully, but these errors were encountered: