-
-
Notifications
You must be signed in to change notification settings - Fork 18.3k
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
BUG: output of a transform is cast to dtype of input #10972
Labels
Milestone
Comments
This is only a problem with transform; apply does this kind of inference
|
Yeah, I've switched to apply for now. My actual case was transforming an integer to categorical (which raised an exception). |
doesn't make sense to |
Not that simple in my case. Have to groupby a level and do some shift / diff logic to get my result. |
4 tasks
This was referenced Feb 17, 2017
jreback
added a commit
to jreback/pandas
that referenced
this issue
Feb 27, 2017
The transform() operation needs to return a like-indexed. To facilitate this, transform starts with a copy of the original series. Then, after the computation for each group, sets the appropriate elements of the copied series equal to the result. At that point is does a type comparison, and discovers that the timedelta is not cast- able to a datetime. closes pandas-dev#10972 Author: Jeff Reback <[email protected]> Author: Stephen Rauch <[email protected]> Closes pandas-dev#15430 from stephenrauch/group-by-transform-timedelta-from-datetime and squashes the following commits: c3b0dd0 [Jeff Reback] PEP fix 2f48549 [Jeff Reback] fixup slow transforms cc43503 [Stephen Rauch] BUG: GH15429 transform result of timedelta from datetime
jreback
added a commit
to jreback/pandas
that referenced
this issue
Feb 27, 2017
The transform() operation needs to return a like-indexed. To facilitate this, transform starts with a copy of the original series. Then, after the computation for each group, sets the appropriate elements of the copied series equal to the result. At that point is does a type comparison, and discovers that the timedelta is not cast- able to a datetime. closes pandas-dev#10972 Author: Jeff Reback <[email protected]> Author: Stephen Rauch <[email protected]> Closes pandas-dev#15430 from stephenrauch/group-by-transform-timedelta-from-datetime and squashes the following commits: c3b0dd0 [Jeff Reback] PEP fix 2f48549 [Jeff Reback] fixup slow transforms cc43503 [Stephen Rauch] BUG: GH15429 transform result of timedelta from datetime
AnkurDedania
pushed a commit
to AnkurDedania/pandas
that referenced
this issue
Mar 21, 2017
The transform() operation needs to return a like-indexed. To facilitate this, transform starts with a copy of the original series. Then, after the computation for each group, sets the appropriate elements of the copied series equal to the result. At that point is does a type comparison, and discovers that the timedelta is not cast- able to a datetime. closes pandas-dev#10972 Author: Jeff Reback <[email protected]> Author: Stephen Rauch <[email protected]> Closes pandas-dev#15430 from stephenrauch/group-by-transform-timedelta-from-datetime and squashes the following commits: c3b0dd0 [Jeff Reback] PEP fix 2f48549 [Jeff Reback] fixup slow transforms cc43503 [Stephen Rauch] BUG: GH15429 transform result of timedelta from datetime
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
xref #11444, #13046 for addtl tests
I expected a float. No idea how difficult this will be so I marked it for 0.18. I won't have time to get to it any earlier, but if someone else wants to...
The text was updated successfully, but these errors were encountered: