def apply_empty_result(self):
<EOL>if self.result_type not in ['<STR_LIT>', None]:<EOL><INDENT>return self.obj.copy()<EOL><DEDENT>reduce = self.result_type == '<STR_LIT>'<EOL>from pandas import Series<EOL>if not reduce:<EOL><INDENT>EMPTY_SERIES = Series([])<EOL>try:<EOL><INDENT>r = self.f(EMPTY_SERIES, *self.args, **self.kwds)<EOL>reduce = not isinstance(r, Series)<EOL><DEDENT>except Exception:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>if reduce:<EOL><INDENT>return self.obj._constructor_sliced(np.nan, index=self.agg_axis)<EOL><DEDENT>else:<EOL><INDENT>return self.obj.copy()<EOL><DEDENT>
we have an empty result; at least 1 axis is 0

we will try to apply the function to an empty
series in order to see if this is a reduction function