Skip to content
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

groupby string function-name shortcuts don't work with transform #1362

Closed
wesm opened this issue May 31, 2012 · 0 comments
Closed

groupby string function-name shortcuts don't work with transform #1362

wesm opened this issue May 31, 2012 · 0 comments
Assignees
Milestone

Comments

@wesm
Copy link
Member

wesm commented May 31, 2012

df.groupby('key1')['data1'].transform('mean')
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
/home/wesm/Dropbox/book/svn/book_scripts/notebooks/<ipython-input-42-46fdb55e8ac6> in <module>()
----> 1 df.groupby('key1')['data1'].transform('mean')

/home/wesm/code/pandas/pandas/core/groupby.pyc in transform(self, func, *args, **kwargs)
   1298         for name, group in self:
   1299             object.__setattr__(group, 'name', name)
-> 1300             res = func(group, *args, **kwargs)
   1301             indexer = self.obj.index.get_indexer(group.index)
   1302             np.put(result, indexer, res)

TypeError: 'str' object is not callable
@ghost ghost assigned wesm May 31, 2012
@wesm wesm closed this as completed in 952b272 Jun 2, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant