title: How to get the index of the last condition and assign it to other columns
body: <p>condition is column 'A' &gt; 0.5</p>
  <p>I want to calculate the index of the last condition established and assign it to column 'cond_index'</p>
  <pre><code>          A    cond_index
  0  0.001566           NaN
  1  0.174676           NaN
  2  0.553506           2
  3  0.583377           3
  4  0.418854           3
  5  0.836482           5
  6  0.927756           6
  7  0.800908           7
  8  0.277646           7
  9  0.388323           7
  </code></pre>