Delving into a Pandas source, it looks like it's a criminal:
if not all(self.shape):
is_reduction = False
try:
is_reduction = not isinstance(f(_EMPTY_SERIES), Series)
except Exception:
pass
if is_reduction:
return Series(NA, index=self._get_agg_axis(axis))
else:
return self.copy()
It seems that Pandas calls the function with no arguments in an attempt to guess whether the result should be Seriesor DataFrame.
I guess the patch is fine.
Edit : this problem has been fixed, and now it is documented and allows you to use the parameter reduceto avoid this: http://pandas.pydata.org/pandas-docs/dev/generated/pandas.DataFrame.apply.html