title: pandas: how to group by multiple columns and perform different aggregations on multiple columns?
body: <p>Lets say I have a table that look like this:</p>
  
  <pre><code>Company      Region     Date           Count         Amount
  AAA          XXY        3-4-2018       766           8000
  AAA          XXY        3-14-2018      766           8600
  AAA          XXY        3-24-2018      766           2030
  BBB          XYY        2-4-2018        66           3400
  BBB          XYY        3-18-2018       66           8370
  BBB          XYY        4-6-2018        66           1380
  </code></pre>
  
  <p>I want to get rid of the Date column, then <strong>aggregate by Company AND region</strong> to <strong><em>find the average of Count and sum of Amount</em></strong>.</p>
  
  <p>Expected output:</p>
  
  <pre><code>Company      Region     Count         Amount
  AAA          XXY        766           18630
  BBB          XYY        66            13150
  </code></pre>
  
  <p>I looked into this post here, and many other posts online, but seems like they are only performing one kind of aggregation action (for example, I can aggregate by multiple columns but can only produce one column output as sum OR count, NOT sum AND count)</p>
  
  <p><a href="https://stackoverflow.com/questions/44635626/rename-result-columns-from-pandas-aggregation-futurewarning-using-a-dict-with/44635693#44635693">Rename result columns from Pandas aggregation (&quot;FutureWarning: using a dict with renaming is deprecated&quot;)</a></p>
  
  <p>Can someone help?</p>
  
  <p>What I did:</p>
  
  <p>I followed this post here:</p>
  
  <p><a href="https://www.shanelynn.ie/summarising-aggregation-and-grouping-data-in-python-pandas/" rel="noreferrer">https://www.shanelynn.ie/summarising-aggregation-and-grouping-data-in-python-pandas/</a></p>
  
  <p>however, when i try to use the method presented in this article (toward the end of the article), by using dictionary:</p>
  
  <pre><code>aggregation = {
      'Count': {
          'Total Count': 'mean'
      },
      'Amount': {
          'Total Amount': 'sum'
      }
  }
  </code></pre>
  
  <p>I would get this warning:</p>
  
  <pre><code>FutureWarning: using a dict with renaming is deprecated and will be removed in a future version
    return super(DataFrameGroupBy, self).aggregate(arg, *args, **kwargs)
  </code></pre>
  
  <p>I know it works now but i want to make sure my script works later too. How can I update my code to be compatible in the future?</p>