You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In [46]: print df; df.groupby('key1').transform(lambda x: x.mean())
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
/home/wesm/Dropbox/book/svn/book_scripts/notebooks/<ipython-input-46-656cf72f4323> in <module>()
1 print df
----> 2 df.groupby('key1').transform(lambda x: x.mean())
/home/wesm/code/pandas/pandas/core/groupby.pyc in transform(self, func, *args, **kwargs)
1639 group.T.values[:] = res
1640 else:
-> 1641 group.values[:] = res
1642
1643 applied.append(group)
ValueError: operands could not be broadcast together with shapes (3,4) (2)
data1 data2 key1 key2
0 0.984916 0.904550 a one
1 -1.879638 0.585887 a two
2 0.457879 -0.721776 b one
3 1.585887 0.050336 b two
4 -0.701547 0.525808 a one
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: