title: Apply different functions to different columns with a singe pandas groupby command
body: <p>My data is stored in <code>df</code>. I have multiple <code>users</code> per <code>group</code>. I want to group <code>df</code> by <code>group</code> and apply different functions to different columns. The twist is that I would like to assign custom names to the new columns during this process.</p>
  
  <pre class="lang-py prettyprint-override"><code>np.random.seed(123)
  df = pd.DataFrame({"user":range(4),"group":[1,1,2,2],"crop":["2018-01-01","2018-01-01","2018-03-01","2018-03-01"],
                     "score":np.random.randint(400,1000,4)})
  df["crop"] = pd.to_datetime(df["crop"])
  print(df)
     user  group        crop  score
  0     0      1  2018-01-01    910
  1     1      1  2018-01-01    765
  2     2      2  2018-03-01    782
  3     3      2  2018-03-01    722
  </code></pre>
  
  <p>I want to get the mean of <code>score</code>, and the min and max values of <code>crop</code> grouped by <code>group</code> <strong>and</strong> assign custom names to each new column. The desired output should look like this:</p>
  
  <pre class="lang-py prettyprint-override"><code>  group  mean_score    min_crop    max_crop
  0     1       837.5  2018-01-01  2018-01-01
  1     2       752.0  2018-03-01  2018-03-01
  </code></pre>
  
  <p>I don't know how to do this in a one-liner in Python. In R, I would use <code>data.table</code> and get the following:</p>
  
  <pre><code>df[, list(mean_score = mean(score),
            max_crop   = max(crop),
            min_crop   = min(crop)), by = group]
  </code></pre>
  
  <p>I know I could group the data and use <code>.agg</code> combined with a dictionary. Is there an alternative way where I can custom-name each column in this process?</p>