-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DataFrame does not work well with quantities #1071
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
normally, you'd be able to do something like: nas = pq.Quantity(np.nan, pq.s) However, because pq.Quantity is an ndarray subclass there's some weird behavior. I'm not familiar with quantities internals, but here's what I saw just poking around: In [54]: arr = np.array([np.nan, pq.Quantity(1, pq.s), pq.Quantity(2, pq.s)], dtype=object) In [55]: isnull(arr) In [56]: arr[isnull(arr)] = pq.Quantity(np.nan, pq.s) In [57]: arr Essentially this makes the NaN filling code in pandas have not effect. |
I noticed you can strip dimension by |
closing in favor of #10349 |
raises:
ValueError: Unable to convert between units of "dimensionless" and "s"
Note that the following works w/o error because pandas "strips" dimension:
The text was updated successfully, but these errors were encountered: