-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
BUG: setting td64 value into numeric Series incorrectly casting to int #39488
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
this is deduplicated? |
haven't updated to de-dup yet, turns out to be a little non-trivial bc this makes some view-or-not assertions the other doesnt |
values = np.where(cond, values, other) | ||
if isinstance(other, np.timedelta64) and self.dtype == object: | ||
# https://github.com/numpy/numpy/issues/12550 | ||
# timedelta64 will incorrectly cast to int |
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.
too bad you cannot use np.where then cast back the integers if necessary
prob should add a whatsnew for this change |
We fixed this a few days ago for some of the setting-methods, but there were a few we missed. Re-using the TestSetitemEquivalents pattern is much more thorough.
We'll be able to de-duplicate the test class following #39477