title: Filling date gaps in pandas dataframe
body: <p>I have Pandas DataFrame (loaded from .csv) with Date-time as index.. where there is/have-to-be one entry per day.
  The problem is that I have gaps i.e. there is days for which I have no data at all.
  What is the easiest way to insert rows (days) in the gaps ? Also is there a way to control what is inserted in the columns as data ! Say 0 OR copy the prev day info OR to fill sliding increasing/decreasing values in the range from prev-date toward next-date data-values.</p>
  
  <p>thanks</p>
  
  <p>Here is example 01-03 and 01-04 are missing :</p>
  
  <pre><code>In [60]: df['2015-01-06':'2015-01-01']
  Out[60]: 
             Rate  High (est)  Low (est)
  Date                                      
  2015-01-06  1.19643      0.0000     0.0000
  2015-01-05  1.20368      1.2186     1.1889
  2015-01-02  1.21163      1.2254     1.1980
  2015-01-01  1.21469      1.2282     1.2014
  </code></pre>
  
  <hr>
  
  <p>Still experimenting but this seems to solve the problem :</p>
  
  <pre><code>df.set_index(pd.DatetimeIndex(df.Date),inplace=True)
  </code></pre>
  
  <p>and then resample... the reason being that importing the .csv with header-col-name Date, is not actually creating date-time-index, but Frozen-list whatever that means.
  resample() is expecting : if isinstance(ax, DatetimeIndex): .....</p>
  
  <hr>
  
  <p>Here is my final solution :</p>
  
  <pre><code>  #make dates the index
    self.df.set_index(pd.DatetimeIndex(self.df.Date), inplace=True)
    #fill the gaps
    self.df = self.df.resample('D',fill_method='pad')
    #fix the Date column
    self.df.Date = self.df.index.values
  </code></pre>
  
  <p>I had to fix the Date column, because resample() just allow you to pad-it.
  It fixes the index correctly though, so I could use it to fix the Date column.</p>
  
  <p>Here is snipped of the data after correction :</p>
  
  <pre><code>2015-01-29 2015-01-29  1.13262      0.0000     0.0000
  2015-01-30 2015-01-30  1.13161      1.1450     1.1184
  2015-01-31 2015-01-31  1.13161      1.1450     1.1184
  2015-02-01 2015-02-01  1.13161      1.1450     1.1184
  </code></pre>
  
  <p>01-30, 01-31 are the new generated data.</p>