title: Using polyfit with date series
body: <p>How can I manage the date series with this kind of data into the polyfit without any errors.</p>
  <pre><code>data1 = np.array(['1801-01-01', '1802-01-01', '1803-01-01', '1804-01-01', '1805-01-01'])
  data2 = np.array([5, 6, 7, 8, 9])
  ser1 = pd.Series(data1)
  ser2 = pd.Series(data2)
  date = pd.to_datetime(ser1)
  a, b = np.polyfit(date, ser2, 1)
  </code></pre>
  <p>the error message says</p>
  <pre><code>UFuncTypeError: ufunc 'add' cannot use operands with types dtype('&lt;M8[ns]') and dtype('float64')
  </code></pre>
  <p>Is there a way to transform the date into a float to make the polyfit work?</p>