title: Group by date and count values in pandas dataframe
body: <p>I have the following pandas dataframe (I am using python):</p>
  <pre><code>import pandas as pd
  
  df = pd.DataFrame({
  'date': ['2020-07-01', '2020-07-01', '2020-07-01', '2020-07-01', '2020-07-02', '2020-07-02', '2020-07-02'],
  'value': ['abc', 'abc', 'abc', 'bb', 'bb', 'bb', 'c']})
  
  df.head(7)
  
      date    value
  0   2020-07-01  abc
  1   2020-07-01  abc
  2   2020-07-01  abc
  3   2020-07-01  bb
  4   2020-07-02  bb
  5   2020-07-02  bb
  6   2020-07-02  c
  </code></pre>
  <p>How can I get this:</p>
  <pre><code>    date    value  count
  0   2020-07-01  abc  3
  1   2020-07-01  bb   1
  2   2020-07-02  bb   2
  3   2020-07-02  c    1
  </code></pre>
  <p>or this:</p>
  <pre><code>    date    value  count
  0   2020-07-01  abc  3
                  bb   1
  1   2020-07-02  bb   2
                  c    1
  </code></pre>
  <p>Both solutions work equally fine for me.</p>