Skip to content

BUG: groupby.transform confused about index #9700

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

Closed
dsm054 opened this issue Mar 22, 2015 · 0 comments · Fixed by #9994
Closed

BUG: groupby.transform confused about index #9700

dsm054 opened this issue Mar 22, 2015 · 0 comments · Fixed by #9994
Milestone

Comments

@dsm054
Copy link
Contributor

dsm054 commented Mar 22, 2015

Under some circumstances, transform is getting confused about what the output index should be:

>>> df = pd.DataFrame({"c1": [1], "c2": [2]})
>>> df
   c1  c2
0   1   2
>>> df.groupby('c1').transform(sum)
   c2
0 NaN
1   2

I haven't chased down why, but since we have

>>> df.groupby('c1').transform(lambda x: sum(x))
   c2
0   2

it must be another fast-path problem, like #9697.

@jreback jreback modified the milestones: 0.16.1, Next Major Release Mar 23, 2015
evanpw added a commit to evanpw/pandas that referenced this issue Apr 26, 2015
@jreback jreback modified the milestones: 0.16.1, Next Major Release Apr 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants