title: Pandas df.resample with column-specific aggregation function
body: <p>With <a href="https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.resample.html" rel="nofollow noreferrer">pandas.DataFrame.resample</a> I can downsample a DataFrame:</p>
  <pre><code>df.resample(&quot;3s&quot;, how=&quot;mean&quot;)
  </code></pre>
  <p>This resamples a data frame with a datetime-like index such that all values within 3 seconds are aggregated into one row. The values of the columns are averaged.</p>
  <p>Question: I have a data frame with multiple columns. Is it possible to specify a different aggregation function for different columns, e.g. I want to <code>&quot;sum&quot;</code> column <code>x</code>, <code>&quot;mean&quot;</code> column <code>y</code> and pick the <code>&quot;last&quot;</code> for column <code>z</code>? How can I achieve that effect?</p>
  <p>I know I could create a new empty data frame, and then call <code>resample</code> three times, but I would prefer a faster in-place solution.</p>