-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
FIX DataFrame diff with timedelta #7280
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
hmm seems a bit special casey |
true, perhaps better to change the dtype of arr_out / view, but couldn't get that to work... |
I think you need to set the dtype of e.g. |
@hayd ? |
1 similar comment
@hayd ? |
@hayd ? |
@jreback Did you think this was too special casey? (will change the view dtype and see if this passes). |
@hayd it might be, but not sure how can avoid this, |
@jreback ok cool, in general it's good to be uncomfortable/point out/whine about special casey-ness. :) |
@@ -813,7 +813,8 @@ def diff(arr, n, axis=0): | |||
na_indexer[axis] = slice(None, n) if n >= 0 else slice(n, None) | |||
out_arr[tuple(na_indexer)] = na | |||
|
|||
if arr.ndim == 2 and arr.dtype.name in _diff_special: | |||
if (arr.ndim == 2 and arr.dtype.name in _diff_special |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually I would do this slightly differently. I would define the dtype of out_arr
(as the same as the input type), except for datetime64[ns]
, then I think you can use this as is.
closing this as picking it up in #8184 |
thanks @jreback, sorry for dropping the ball on a few PRs. |
fixes #4533
need to fix test in numpy 1.6...