def _apply(self, f, grouper=None, *args, **kwargs):
def func(x):<EOL><INDENT>x = self._shallow_copy(x, groupby=self.groupby)<EOL>if isinstance(f, str):<EOL><INDENT>return getattr(x, f)(**kwargs)<EOL><DEDENT>return x.apply(f, *args, **kwargs)<EOL><DEDENT>result = self._groupby.apply(func)<EOL>return self._wrap_result(result)<EOL>
Dispatch to _upsample; we are stripping all of the _upsample kwargs and
performing the original function call on the grouped object.