title: How to merge partial row into one single row
body: <p>I have a result data frame with only indices to be populated with results that comes through on a row by row operation.</p>
  
  <pre><code>       a   res1   res2   res3  
      0  1
      1  4  
      2  0 
      3  1  
      4  5  
  </code></pre>
  
  <p>I'm looping through each row with </p>
  
  <pre><code>    df.apply(func, axis=1) 
  </code></pre>
  
  <p>which points to another function coming up with results for each row. The results are calculated from other dfs and I basically do a linear combination of several rows depending on the index column a like so:</p>
  
  <pre><code>    def func(row):
          ...
          combinedrow = x*df2.iloc[index1]+y*df3.iloc[index2] + etc..
  </code></pre>
  
  <p>Each of the other dfs have the same results headings. I want to basically insert this row result into each row like this:</p>
  
  <pre><code>       a  res1  res2   res3
      0  1   2      3      4
      1  4  
      2  0 
      3  1  
      4  5           
  </code></pre>
  
  <p>it has to be done one row at a time because of the apply() function. </p>
  
  <p>How do i do the partial row merge? Performance is very important, hence i've not inserted each number separately under the columns. </p>