title: pandas fill value between the index of two rows(rows only find by a value)
body: <p>I have a Series <code>df</code>:</p>
  
  <pre><code>index 
  0     1
  1     1
  2     1
  3     1
  4     1
  5    -1
  6    -1
  7    -1
  8     1
  9     1
  10    1
  11   -1
  dtype: int64
  </code></pre>
  
  <p>Another <code>boolean</code> Series is likes indicator or points <code>b</code>:</p>
  
  <pre><code>index 
  0     False
  1     False
  2     True
  3     False
  4     False
  5     False
  6     True
  7     False
  8     False
  9     True
  10    False
  11    False
  </code></pre>
  
  <p>I can set the <code>df</code> values using <code>b</code>, <code>df[b]=0</code>:</p>
  
  <pre><code>index 
  0     1
  1     1
  2     0
  3     1
  4     1
  5    -1
  6     0
  7    -1
  8     1
  9     0
  10    1
  11   -1
  </code></pre>
  
  <p>And now what I want to fill the values between <code>2:5</code>,<code>6:7</code>,<code>9:11</code> with the value <code>-1</code> and the result I want is a new <code>df</code>:</p>
  
  <pre><code>index 
  0     1
  1     1
  2    -1
  3    -1
  4    -1
  5    -1
  6    -1
  7    -1
  8     1
  9    -1
  10   -1
  11   -1 
  </code></pre>
  
  <p>Which means when <code>b</code> is <code>True</code>, (index:2,6,9), I would fill the value <code>1</code> in <code>df</code> between the index(index:2,6,9) and the index of the nearest <code>-1</code> values (index:5,7,11).</p>
  
  <p>The fill value is <code>-1</code>, the fill range is <code>[2:5,6:7,9:11]</code></p>
  
  <p>I've thought method like <code>where</code>, <code>replace</code>, <code>pad</code> etc, but cannot work it out. Maybe find its index array <code>[2,6,9]</code>,and the nearest <code>-1</code> array <code>[5,7,11]</code>, and rearrange into <code>[2:5,6:7,9:11]</code> is a way.</p>
  
  <p>Is there some ways more useful?</p>