-
Notifications
You must be signed in to change notification settings - Fork 42
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
cumsum() changes dtype to object #42
Comments
I'm assuming this is the case for all numpy functions. I haven't looked how numpy operations work pandas, we may need to handle them within pint-pandas for them to work nicely. For your workaround, there is a private method for creating a PintArray from a numpy array. I'm not sure what units your workaround results in. |
Just a note that I've run into this to. My workaround involves letting cumsum wreck the PintArray and then re-creating it with a call to astype(). But it would be so nice if cumsum would honor the Extension Array. |
fixed by #186 |
i
i.cumsum()
this is likely caused by np.cumsum on an PintArray resulting in an numpy array of Quantity objects because it falls back to a loop of + operations?
My manual workaround is:
my_series.to_frame('power').pint.dequantify().cumsum().pint.quantify()
The text was updated successfully, but these errors were encountered: