title: How to spot gaps between pandas dataframe indexes?
body: <p>This code creates an dataframe with 10 minute range index:</p>
  
  <pre><code>import pandas as pd 
  import datetime as dt 
  
  date_range = pd.date_range(end=dt.datetime(2017, 1, 6, 15, 00), periods=10, freq='10Min')
  
  df = pd.DataFrame(index=date_range)
  df['A'] = 1
  
  print(df)
  </code></pre>
  
  <p>It outputs:</p>
  
  <pre><code>                     A
  2017-01-06 13:30:00  1
  2017-01-06 13:40:00  1
  2017-01-06 13:50:00  1
  2017-01-06 14:00:00  1
  2017-01-06 14:10:00  1
  2017-01-06 14:20:00  1
  2017-01-06 14:30:00  1
  2017-01-06 14:40:00  1
  2017-01-06 14:50:00  1
  2017-01-06 15:00:00  1
  </code></pre>
  
  <p>My question is:</p>
  
  <p>How may I set A column to 0 in the following three rows when there is a gap between the indexes?</p>
  
  <p>For example, if we delete an specific row:</p>
  
  <pre><code>df = df[df.index != dt.datetime(2017, 1, 6, 14, 00)]
  </code></pre>
  
  <p>It outputs:</p>
  
  <pre><code>                     A
  2017-01-06 13:30:00  1
  2017-01-06 13:40:00  1
  2017-01-06 13:50:00  1
  2017-01-06 14:10:00  1
  2017-01-06 14:20:00  1
  2017-01-06 14:30:00  1
  2017-01-06 14:40:00  1
  2017-01-06 14:50:00  1
  2017-01-06 15:00:00  1
  </code></pre>
  
  <p>Now, there is a missing 10 minute range before 13:50, so the following 3 A rows must be setted to 0.</p>
  
  <p>So this would be the desired result:</p>
  
  <pre><code>                     A
  2017-01-06 13:30:00  1
  2017-01-06 13:40:00  1
  2017-01-06 13:50:00  1
  2017-01-06 14:10:00  0
  2017-01-06 14:20:00  0
  2017-01-06 14:30:00  0
  2017-01-06 14:40:00  1
  2017-01-06 14:50:00  1
  2017-01-06 15:00:00  1
  </code></pre>
  
  <p>There is a python fiddle so you can try: <a href="https://repl.it/FaXZ/2" rel="nofollow noreferrer">https://repl.it/FaXZ/2</a></p>