title: Pandas Groupby: How to use two lambda functions?
body: <p>I can currently do the following in Pandas, but I get a stern finger wagging from FutureWarning:</p>
  
  <pre><code>grpd = df.groupby("rank").agg({
      "mean": np.mean, "meian": np.median, "min": np.min, "max": np.max, 
      "25th percentile": lambda x: np.percentile(x, 25),
      "75th percentile": lambda x: np.percentile(x, 75)
  })
  </code></pre>
  
  <p>The following throws an error because I have two lambda functions:</p>
  
  <pre><code>percentile_25 = lambda x: np.percentile(x, 25)
  percentile_75 = lambda x: np.percentile(x, 75)
  
  df = diffs[["User Installs", "rank"]].dropna()
  grpd = df.groupby("shopping_rank").agg([
      np.mean, np.median, np.min, np.max, 
      percentile_25, percentile_75
  ])
  </code></pre>
  
  <p>This throws:</p>
  
  <pre><code>SpecificationError: Function names must be unique, found multiple named &lt;lambda&gt;
  </code></pre>
  
  <p>The only way I can seem to make this work (without ignoring the warning, which I should probably just do) is with an elaborate process like the following</p>
  
  <ol>
  <li>Define my DF with one lambda function (25th percentile), and everything else I need (min, max, etc.)</li>
  <li>rename the cols to get rid of the MultiIndex</li>
  <li>Create ANOTHER DF, do ANOTHER grouping, this time with the other column I want (75th percentile)</li>
  <li>Rename cols again (thanks MultiIndex!)</li>
  <li>Join back to the original DF on the index</li>
  </ol>
  
  <p>Is there something I'm missing here? Surely there's a better way to do what I imagine is a pretty common thing (using two aggregations that aren't directly importable from numpy).</p>