title: Pandas GroupBy Aggregation Behavior
body: <p>I observed a behavior of the Pandas GroupBy method <code>agg()</code> which I cannot explain based on the <a href="https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.core.groupby.DataFrameGroupBy.aggregate.html" rel="nofollow noreferrer">docs</a>.</p>
  <p>I want to perform a custom aggregation on a grouped <code>DataFrame</code>. Let's take this code snippet:</p>
  <pre class="lang-py prettyprint-override"><code>def aggregate_point(x):
   print(x)
   exit()
  
  data = data.groupby(
   pd.Grouper(level='time', freq='1H')).agg(aggregate_point)
  </code></pre>
  <p>This prints a <code>Series</code> for each group.</p>
  <p>However, when I pass any additional parameter to <code>aggregate_point</code>, the full <code>DataFrame</code> is being printed:</p>
  <pre class="lang-py prettyprint-override"><code>def aggregate_point(x, score):
   print(x)
   exit()
  
  data = data.groupby(
   pd.Grouper(level='time', freq='1H')).agg(aggregate_point, score=True)
  </code></pre>
  <p>Why does the <code>score</code> parameter influence the value of <code>x</code> (<code>DataFrame</code> vs. <code>Series</code>)?</p>