We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I was playing a bit with pd.Grouper. Shouldn't the following work:
pd.Grouper
In [109]: df = pd.DataFrame({'A':[0,0,1,1,2,2], 'B':[1,2,3,4,5,6]}) In [110]: df Out[110]: A B 0 0 1 1 0 2 2 1 3 3 1 4 4 2 5 5 2 6 In [111]: df.groupby(pd.Grouper(key='A')).sum() --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-111-b9e051aabea3> in <module>() ----> 1 df.groupby(pd.Grouper(key='A')).sum() C:\Anaconda\lib\site-packages\pandas\core\groupby.pyc in f(self) 108 raise SpecificationError(str(e)) 109 except Exception: --> 110 result = self.aggregate(lambda x: npfunc(x, axis=self.axis)) 111 if _convert: 112 result = result.convert_objects() C:\Anaconda\lib\site-packages\pandas\core\groupby.pyc in aggregate(self, arg, *a rgs, **kwargs) 2634 return getattr(self, cyfunc)() 2635 -> 2636 if self.grouper.nkeys > 1: 2637 return self._python_agg_general(arg, *args, **kwargs) 2638 else: AttributeError: 'Int64Index' object has no attribute 'nkeys'
The text was updated successfully, but these errors were encountered:
yep, seems like a bug, that should work
of course df.groupby('A').sum() is the test against this
df.groupby('A').sum()
Sorry, something went wrong.
It seems this already was broken in 0.14.1
Successfully merging a pull request may close this issue.
I was playing a bit with
pd.Grouper
. Shouldn't the following work:The text was updated successfully, but these errors were encountered: