title: Datetime number of days difference group by months and years
body: <p>I want to find the days between two dates, but grouped by months and years.</p>
  <p>Referring to <a href="https://stackoverflow.com/questions/59991491/datetime-number-of-days-difference-group-by-months">Datetime number of days difference group by months</a></p>
  <pre><code>import calendar
  from datetime import datetime, timedelta
  from itertools import groupby
  
  start = datetime(2020,12,30) 
  end = datetime(2021,12,15) 
  </code></pre>
  <p>if the start year and end year is different, and i need the result group by month and year. How could i apply the code to get the answer?</p>
  <p>Thank you so mucd</p>