Pythonic way of copying values in an array with a complex rule
<p>If the value in column <code>a</code> is 1 then the value of <code>b</code> is copied in column <code>c</code> until <code>a</code> is -1.</p>

<p>In the example below, <code>a</code> is 1 in row 2 and -1 in row 5. Then the second value in column <code>b</code> (13) is copied in column <code>c</code> from row 2 to 5.</p>

<pre><code>row a   b   c
1   0  12   0
2   1  13  13
3   0  15  13
4   0   2  13
5  -1  19  13
6   0  34   0
7   0  11   0
8   1  23  23
9   0  14  23
10 -1   9  23
11  0  18   0
12  0  19   0
</code></pre>

<p>I've done this with a for loop, but there must be a more elegant way to do this manipulating series (I'm using pandas, numpy). All your help is greatly appreciated.</p>
