title: Calculate Aggregate Mode
body: <p>I have a dataframe :</p>
  
  <pre><code>ID CATEGORY AMOUNT
  1   T1       1000
  2   T2       1500
  3   T3       2000
  4   T4       3000
  5   T1       2000
  6   T2       2500
  7   T3       7000
  8   T4       4000
  9   T1       1000
  10   T2      1500
  11   T3      2000
  12   T4      3000 
  </code></pre>
  
  <p>I want to <code>groupby</code> category and then get the mode of each category:</p>
  
  <pre><code>T1 1000
  T2 1500
  </code></pre>
  
  <p>All the way to T4. When I run the below python code I get an error:</p>
  
  <pre><code>df['AMOUNT'].groupby(df['CATEGORY']).mode()
  </code></pre>
  
  <p>I get the below error</p>
  
  <blockquote>
    <p>AttributeError: Cannot access callable attribute 'mode' of 'SeriesGroupBy' objects, try using the 'apply' method</p>
  </blockquote>