title: Python Pandas group by month and year
body: <p>I have the following,</p>
  
  <pre><code>import pandas as pd
  
  data = [['AAA','2019-01-01', 10], ['AAA','2019-01-02', 20],
          ['AAA','2019-02-01', 30], ['AAA','2019-02-02', 40],
          ['BBB','2019-01-01', 50], ['BBB','2019-01-02', 60],
          ['BBB','2019-02-01', 70],['BBB','2019-02-02', 80]]
  
  dfx = pd.DataFrame(data, columns = ['NAME', 'TIMESTAMP','VALUE'])
  
    NAME   TIMESTAMP  VALUE
  0  AAA  2019-01-01     10
  1  AAA  2019-01-02     20
  2  AAA  2019-02-01     30
  3  AAA  2019-02-02     40
  4  BBB  2019-01-01     50
  5  BBB  2019-01-02     60
  6  BBB  2019-02-01     70
  7  BBB  2019-02-02     80
  </code></pre>
  
  <p>I am trying to do a sum on the column 'VALUE' grouped by MONTH and YEAR in the 'TIMESTAMP' and 'NAME' columns.</p>
  
  <p>So the final desired output is,</p>
  
  <pre><code>  NAME   TIMESTAMP  VALUE SUM
  0  AAA  2019-01-01     10  30
  1  AAA  2019-01-02     20  30
  2  AAA  2019-02-01     30  70
  3  AAA  2019-02-02     40  70
  4  BBB  2019-01-01     50 110
  5  BBB  2019-01-02     60 110
  6  BBB  2019-02-01     70 150
  7  BBB  2019-02-02     80 150
  </code></pre>
  
  <p>How do I get this output?</p>
  
  <p>Thanks.</p>