title: Pandas groupby and add count
body: <p>I would like to add a count of the grouped rows with my groupby.
  Example:</p>
  <pre><code>name, amount
  test, 1
  test2, 5
  test, 3
  test3, 8
  test2, 4
  test, 1
  </code></pre>
  <p>Should give:</p>
  <pre><code>name, amount, count
  test, 5, 3
  test2, 9, 2
  test3, 8, 1
  </code></pre>
  <p>My current groupby statements:</p>
  <pre><code>df = (df.groupby('name')['amount'].sum().reset_index().sort_values(by='name', ascending=True))
  ...
  df = df.groupby(pd.cut(df['name'], 
             bins=[0,1,2], 
             labels=['A', 'B']))['amount'].sum().reset_index()
  </code></pre>