-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
API: boolean dtype upsets cumsum #4170
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
silently converts |
seems the opposite of what you would expect...
|
This is the way python's nan works, so I think it's not numpy's fault:
strange.. |
if there are |
[31] should raise like it does when you try to insert NaN into int, which gives:
(perhaps that should be upcast though...) |
can you post an example with |
Do you mean for int:
and for bool
|
both of these need to wait for #3482 as this is very tricky to fix in the current implementation. in essence you need in-place dtype changing of a numpy array where the actual itemsize of the dtype changes...(some cases this works, but others it doesn't) |
Is that nearly mergeable? :) |
yes |
(not) casting on assignment tho is separate from this. this just fixes the 2 methods @jreback is it even possible (without resorting to trickery) to do an in-place update of an i can put in a test for |
ok maybe wait for #3482 |
for sure |
@cpcloud do you want me to make a separate issue for that? I tagged it cheekily on the end... my bad |
@hayd 😄 no problem! that would be great. |
fwiw i think this particular issue |
yes that is right I was talking about in place dtype conversions |
I'm not sure that in-place dtype conversions are really the answer. I guess we just need to tackle the NA problem one of these days. I have some ideas but it's a big project and I personally won't have the resources for it for some time. |
cumsum seems to require skipna=False otherwise it sulks here. (Not investigate which others are also affected, cumprod is though).
If it has nans or you int or object it works as expected:
Also, if you try and inset an nan it doesn't work nor raise (!):
The text was updated successfully, but these errors were encountered: