title: Insert row in Pandas Dataframe based on a condition
body: <p>I'm using Pandas to process huge time series dataset. I would like add row between the rows in the dataframe if the difference between two consecutive indexes is greater than 5.</p>
  
  <p>Actual: </p>
  
  <pre><code>            a  result
  Date                 
  1497544649  1     1.0
  1497544652  9     1.0
  1497544661  9     NaN
  </code></pre>
  
  <p>Expected: </p>
  
  <pre><code>            a  result
  Date                 
  1497544649  1     1.0
  1497544652  9     1.0
  1497544657  9     0
  1497544661  9     NaN
  </code></pre>
  
  <p>I used <em>diff()</em> on index to get difference between two consecutive indexes but not sure how to insert record if the difference is greater than 5. </p>
  
  <pre><code>import pandas as pd
  
  df = pd.DataFrame([{"Date": 1497544649,"a":1, "result": 1}, 
                     {"Date": 1497544652,"a": 9, "result": 1},
                     {"Date": 1497544661,"a": 9, "result": 1}])
  df.set_index("Date", inplace=True)
  
  df.index.to_series().diff().fillna(0).to_frame("diff")
  </code></pre>
  
  <p>Any pointers on how to achieve this would be appreciated</p>
  
  <p>Thank you</p>