title: How to set pandas dataframe to NaN using last_valid_index() of another column
body: <p>How to set the column of a pandas dataframe to NaN using the index above the <code>last_valid_index()</code> of another column to NaN. </p>
  
  <p>In [2]: df</p>
  
  <pre><code>          A         B
  0  1.068932 -0.794307
  2 -0.470056  1.192211
  4 -0.284561  0.756029
  6  1.037563 -0.267820
  8 -0.538478 NaN
  9. 1.03733  NaN
  10.1.037562 NaN
  </code></pre>
  
  <p>For example: <code>df.B.last_valid_index()</code> will give <code>6</code>. So I want all rows in column A where <code>index &lt; 6</code> be set to <code>NaN</code></p>
  
  <p>final result should be:</p>
  
  <pre><code>     A         B
  0   NaN    -0.794307
  2   NaN     1.192211
  4   NaN     0.756029
  6   NaN    -0.267820
  8 -0.538478 NaN
  9. 1.03733  NaN
  10.1.037562 NaN
  </code></pre>