title: pandas: subtracting current date from the date in a pandas table
body: <p>I am attempting to calculate the difference in days between todays and a pandas data consisting of historical data. Below is the intended code:</p>
  
  <pre><code>df['diff'] = pd.to_datetime( df['date']) - pd.datetime.now().date()
  </code></pre>
  
  <p>However, it produces the following error:</p>
  
  <blockquote>
    <p>TypeError: unsupported operand type(s) for -: 'DatetimeIndex' and
    'datetime.date'</p>
  </blockquote>
  
  <p>The date column in the pandas table looks like this:</p>
  
  <pre><code>0       2018-12-18
  1       2018-12-18
  2       2018-12-18
  3       2018-12-18
  4       2018-12-18
  </code></pre>
  
  <p>How do I fix this error. Thanks in advance.</p>