title: Total sum amount per month using date time in Python
body: <p>Now I have a list of dates and values, but I don't know how to do calculations with the date structure.</p>
  
  <p>It looks like </p>
  
  <pre><code>[[datetime.date(2018, 8, 10) 1076.2392505636847]
   [datetime.date(2018, 8, 11) 3537.9781979862732]
   [datetime.date(2018, 8, 12) 8637.536518161462]
   [datetime.date(2018, 8, 13) 15660.768121458246]
   [datetime.date(2018, 8, 14) 21087.477911830327]
   [datetime.date(2018, 8, 15) 21087.477911830327]
   [datetime.date(2018, 8, 16) 15660.768121458246]
   [datetime.date(2018, 8, 17) 8637.536518161465]
   [datetime.date(2018, 8, 18) 3537.9781979862732]
   [datetime.date(2018, 8, 19) 1076.2392505636856]]
  </code></pre>
  
  <p>also, I know that </p>
  
  <pre><code>startdate = datetime.date(2018, 8, 10)
  enddate = datetime.date(2018,8, 19)
  </code></pre>
  
  <p>I want to create another list that consists of ['Year-Month' data, total sum of the month]. In this case, it will be just ['2018-8' total sum]. if enddate is like 2020,8,19, then the length would be 25 (two years and a month).</p>
  
  <p>Could you share some useful functions/approaches that I may use?</p>