Skip to content

Pure python apply broken with TimeGrouper #1057

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
wesm opened this issue Apr 14, 2012 · 0 comments
Closed

Pure python apply broken with TimeGrouper #1057

wesm opened this issue Apr 14, 2012 · 0 comments
Labels
Milestone

Comments

@wesm
Copy link
Member

wesm commented Apr 14, 2012


In [12]: s.convert('D', how='count')
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/home/wesm/code/pandas/<ipython-input-12-52597b6f97c4> in <module>()
----> 1 s.convert('D', how='count')

/home/wesm/code/pandas/pandas/core/generic.pyc in convert(self, rule, method, how, axis, as_index, closed, label)
    179                 how = translate_grouping(how)
    180 
--> 181             result = grouped.agg(how)
    182         else:
    183             # upsampling

/home/wesm/code/pandas/pandas/core/groupby.pyc in agg(self, func, *args, **kwargs)
    246         See docstring for aggregate
    247         """
--> 248         return self.aggregate(func, *args, **kwargs)
    249 
    250     def _iterate_slices(self):

/home/wesm/code/pandas/pandas/core/groupby.pyc in aggregate(self, func_or_funcs, *args, **kwargs)
   1263         """
   1264         if isinstance(func_or_funcs, basestring):
-> 1265             return getattr(self, func_or_funcs)(*args, **kwargs)
   1266 
   1267         if hasattr(func_or_funcs,'__iter__'):

/home/wesm/code/pandas/pandas/core/groupby.pyc in wrapper(*args, **kwargs)
    178                 return self.apply(curried_with_axis)
    179             except Exception:
--> 180                 return self.apply(curried)
    181 
    182         return wrapper

/home/wesm/code/pandas/pandas/core/groupby.pyc in apply(self, func, *args, **kwargs)
    237         applied : type depending on grouped object and function
    238         """
--> 239         return self._python_apply_general(func, *args, **kwargs)
    240 
    241     def aggregate(self, func, *args, **kwargs):

/home/wesm/code/pandas/pandas/core/groupby.pyc in _python_apply_general(self, func, *args, **kwargs)
    409 
    410         return self._wrap_applied_output(result_keys, result_values,
--> 411                                          not_indexed_same=not_indexed_same)
    412 
    413     def _wrap_applied_output(self, *args, **kwargs):

/home/wesm/code/pandas/pandas/core/groupby.pyc in _wrap_applied_output(self, keys, values, not_indexed_same)
   1335                                         not_indexed_same=not_indexed_same)
   1336         else:
-> 1337             return Series(values, index=_get_index())
   1338 
   1339     def _aggregate_named(self, func, *args, **kwargs):

/home/wesm/code/pandas/pandas/core/groupby.pyc in _get_index()
   1319                 index = MultiIndex.from_tuples(keys, names=key_names)
   1320             else:
-> 1321                 ping = self.grouper.groupings[0]
   1322                 if len(keys) == ping.ngroups:
   1323                     index = ping.group_index

AttributeError: 'TimeGrouper' object has no attribute 'groupings'

In [13]: s.convert('D', how='count')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant