title: Pandas Interpolate dataframe with new length
body: <p>I have a dataframe with columns of Datetime, lat, lon, z. I am reading the data in from a csv file so setting the period for the datetimes do not work. The times are in 6 hour intervals but I want to linearly interpolate the data to hourly intervals. </p>
  
  <p>Go from</p>
  
  <pre><code>       'A'              'B'    'C'   'D'
  0   2010-09-13 18:00:00 16.3 -78.5    1
  1   2010-09-14 00:00:00 16.6 -79.8    6 
  2   2010-09-14 06:00:00 17.0 -81.1    12
  </code></pre>
  
  <p>To</p>
  
  <pre><code>       'A'              'B'    'C'   'D'
  1   2010-09-13 18:00:00 16.3  -78.5   1      
  2   2010-09-13 19:00:00 16.35 -78.7   2
  3   2010-09-13 20:00:00 16.4  -78.9   3
  4   2010-09-13 21:00:00 16.45 -79.1   4
  5   2010-09-13 22:00:00 16.5  -79.3   5
  ....
  </code></pre>
  
  <p>I have tried using the interpolate command but there are no arguments for a new length of the dataframe. </p>
  
  <pre><code>df.interpolate(method='linear')
  </code></pre>
  
  <p>I was thinking that I could use .loc to include 5 rows of NANs between  each line in the data frame and then use the interpolation function but that seems like a bad workaround.</p>
  
  <p><strong>Solution</strong>
  Using DatetimeIndex eliminates the association with the other columns if your initial column was not imported as datetime.</p>
  
  <pre><code>i = pd.DatetimeIndex(start=df['A'].min(), end=df['A'].max(),    freq='H')
  df = df.reindex(i).interpolate()
  print(df)
  </code></pre>
  
  <p>Gives the correct answer.</p>