title: Count number of rows for each ID within 1 year
body: <p>I have a pandas dataframe something like this</p>
  
  <pre><code>Date        ID
  01/01/2016  a
  05/01/2016  a
  10/05/2017  a
  05/05/2014  b
  07/09/2014  b
  12/08/2017  b
  </code></pre>
  
  <p>What I need to do is to add a column which shows the number of entries for each ID that occurred within the last year and another column showing the number within the next year. I've written some horrible code that iterates through the whole dataframe (millions of lines) and does the computations but there must be a better way!</p>