-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: DataFrameGroupBy.transform with axis=1 fails #36308
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
Could I work on this issue? |
I tried the same example with : while gives : what output are we expecting here ? |
@ethanator Absolutely! Simply make a comment here "take" and github will assign it to you. If you encounter any difficulties, feel free to reach out here. @xxsacxx Your 2nd result looks correct to me; the values are shifted 1 to the right, and since there are no values to the left of the first column, you get NaN. The presence of NaN then coerces the dtype to being a float. |
take |
take |
1 similar comment
take |
take |
take |
The following seems to happen on all transform groupby kernels:
results in
ValueError: Length mismatch: Expected axis has 2 elements, new values have 3 elements
.I think the issue is in
pandas.core.groupby.generic._wrap_transformed_output
; this method does not take into accountself.axis
when wrapping the output. All that needs to happen isresult = result.T
and to use the index labels rather than the column labels forcolumns
there.The text was updated successfully, but these errors were encountered: