Skip to content

Groupby mean transform not converting to float #9807

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
hayd opened this issue Apr 4, 2015 · 0 comments
Closed

Groupby mean transform not converting to float #9807

hayd opened this issue Apr 4, 2015 · 0 comments
Labels
Bug Dtype Conversions Unexpected or buggy dtype conversions Groupby
Milestone

Comments

@hayd
Copy link
Contributor

hayd commented Apr 4, 2015

In [11]: df = pd.DataFrame([[1, 3], [2, 3]])

In [12]: df.groupby(1).transform('mean')
Out[12]:
   0
0  1
1  1

In [13]: df.groupby(1).mean()  # converts when it's a normal groupby mean
Out[13]:
     0
1
3  1.5

http://stackoverflow.com/a/29437332/1240268

@jreback jreback added Bug Groupby Dtype Conversions Unexpected or buggy dtype conversions labels Apr 4, 2015
@jreback jreback added this to the 0.16.1 milestone Apr 4, 2015
jcrist added a commit to jcrist/pandas that referenced this issue Apr 13, 2015
Previously `transform` output was always the same dtype as the groupby
object. This allows the output dtype to differ from the input. Fixes pandas-dev#9807.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Dtype Conversions Unexpected or buggy dtype conversions Groupby
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants