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
From the docs: http://pandas-docs.github.io/pandas-docs-travis/groupby.html#taking-the-nth-row-of-each-group
In [1]: df = DataFrame([[1, np.nan], [1, 4], [5, 6]], columns=['A', 'B']) In [2]: g = df.groupby('A') In [3]: g.B.nth(0, dropna=True) --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-3-bcb9dcbefdf5> in <module>() ----> 1 g.B.nth(0, dropna=True) C:\Users\vdbosscj\Scipy\pandas-joris\pandas\core\groupby.py in nth(self, n, drop na) 831 # get a new grouper for our dropped obj 832 grouper, exclusions, obj = _get_grouper(dropped, key=self.keys, axis=self.axis, --> 833 level=self.level, sort=s elf.sort) 834 835 sizes = obj.groupby(grouper).size() C:\Users\vdbosscj\Scipy\pandas-joris\pandas\core\groupby.py in _get_grouper(obj, key, axis, level, sort) 2035 raise AssertionError(errmsg) 2036 -> 2037 ping = Grouping(group_axis, gpr, obj=obj, name=name, level=level , sort=sort) 2038 groupings.append(ping) 2039 C:\Users\vdbosscj\Scipy\pandas-joris\pandas\core\groupby.py in __init__(self, in dex, grouper, obj, name, level, sort) 1874 # no level passed 1875 if not isinstance(self.grouper, (Series, np.ndarray)): -> 1876 self.grouper = self.index.map(self.grouper) 1877 if not (hasattr(self.grouper, "__len__") and 1878 len(self.grouper) == len(self.index)): C:\Users\vdbosscj\Scipy\pandas-joris\pandas\core\index.py in map(self, mapper) 1332 1333 def map(self, mapper): -> 1334 return self._arrmap(self.values, mapper) 1335 1336 def isin(self, values): C:\Users\vdbosscj\Scipy\pandas-joris\pandas\algos.pyd in pandas.algos.arrmap_int 64 (pandas\algos.c:72351)() TypeError: 'NoneType' object is not callable
The text was updated successfully, but these errors were encountered:
related #7580
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
From the docs: http://pandas-docs.github.io/pandas-docs-travis/groupby.html#taking-the-nth-row-of-each-group
The text was updated successfully, but these errors were encountered: