def _groupby_and_aggregate(self, how, grouper=None, *args, **kwargs):
if grouper is None:<EOL><INDENT>self._set_binner()<EOL>grouper = self.grouper<EOL><DEDENT>obj = self._selected_obj<EOL>grouped = groupby(obj, by=None, grouper=grouper, axis=self.axis)<EOL>try:<EOL><INDENT>if isinstance(obj, ABCDataFrame) and callable(how):<EOL><INDENT>result = grouped._aggregate_item_by_item(how, *args, **kwargs)<EOL><DEDENT>else:<EOL><INDENT>result = grouped.aggregate(how, *args, **kwargs)<EOL><DEDENT><DEDENT>except Exception:<EOL><INDENT>result = grouped.apply(how, *args, **kwargs)<EOL><DEDENT>result = self._apply_loffset(result)<EOL>return self._wrap_result(result)<EOL>
Re-evaluate the obj with a groupby aggregation.