title: How to set nan iteratively in column based on other column value?
body: <p>Imagine you have the following df:</p>
  <pre><code>d = {'taxrate#1': [1, 2], 'taxrate#2': [3, np.nan],'line amount#1': [10, 20], 'line amount #2': [50, 12]}
  df = pd.DataFrame(data=d)
  df
  
      taxrate#1   taxrate#2   line amount#1   line amount #2
  0   1             3.0           10            50.0
  1   2             NaN           20            12
  </code></pre>
  <p>Now, I would like to set the value of line amount #2 to nan if taxrate#2 is nan. I would like to do the above iteratively/dynamically, because the line amounts/ taxrates can span up to #10.</p>
  <p>So ideal output would be:</p>
  <pre><code>    taxrate#1   taxrate#2   line amount#1   line amount #2
  0   1             3.0           10            50.0
  1   2             NaN           20            NaN
  </code></pre>
  <p>How to achieve the above?</p>
  <p>Please help!</p>