title: How Can I replace NaN in a row with values in another row Pandas
body: <p>I tried several methods to replace NaN in a row with values in another row, but none of them worked as expected. Here is my Dataframe:</p>
  
  <pre><code>test = pd.DataFrame(
      {
          "a": [1, 2, 3, 4, 5], 
          "b": [4, 5, 6, np.nan, np.nan], 
          "c": [7, 8, 9, np.nan, np.nan], 
          "d": [7, 8, 9, np.nan, np.nan]
       }
  )
  
     a    b    c    d
  0  1   4.0  7.0  7.0
  1  2   5.0  8.0  8.0
  2  3   6.0  9.0  9.0
  3  4   NaN  NaN  NaN
  4  5   NaN  NaN  NaN
  </code></pre>
  
  <p>I need to replace NaN in 4th row with values first row, i.e., </p>
  
  <pre><code>   a     b     c     d
  0  1   **4.0   7.0   7.0**
  1  2    5.0   8.0   8.0
  2  3    6.0   9.0   9.0
  3  4   **4.0   7.0   7.0**
  4  5    NaN   NaN   NaN
  </code></pre>
  
  <p>And the second question is how can I multiply some/part values in a row by a number, for example, I need to double the values in second two when the columns are <code>['b', 'c', 'd']</code>, then the result is:</p>
  
  <pre><code>   a     b     c     d
  0  1    4.0   7.0   7.0
  1  2   **10.0  16.0  16.0**
  2  3    6.0   9.0   9.0
  3  4    NaN   NaN   NaN
  4  5    NaN   NaN   NaN
  </code></pre>