title: Overlay of two dataframe using python
body: <p>Problem:</p>
  <p>I have two dataframes viz '<strong>infm</strong>' and '<strong>ufl</strong>'. In 'ufl', <em>Age</em> and <em>Salary</em> column for Ben and Creg is updated. I want to update the corresponding row in 'infm' too .</p>
  <p>Approach Taken:</p>
  <p>I am iterating through each row of 'infm' and taking 'Name' column to match both dataframe. If corresponding names are matched, then updating the Age column of 'infm' with value in 'ufl'</p>
  <pre><code>Input:
  
  NAME    AGE    SALARY   COUNTRY
  Adam    24     25000     x
  Ben     25     30000     y
  Creg    23     22000     x
  Dawood  25     30000     w
  </code></pre>
  <pre><code>Update on two rows of Input:
  
  NAME    AGE    SAlARY    COUNTRY
  Ben     36     90000      y
  Creg    34     92000      x
  
  </code></pre>
  <pre><code>Expected Output:
  NAME    AGE    SALARY   COUNTRY
  Adam    24     25000     x
  Ben     36     90000     y
  Creg    34     92000     x
  Dawood  25     30000     w
  
  </code></pre>
  <pre><code>Actual output:
  NAME    AGE    SALARY   COUNTRY
  Adam    24     25000     x
  Ben     25     30000     y
  Creg    23     22000     x
  Dawood  25     30000     w
  
  </code></pre>
  <pre><code>
  Code used:
  
  import pandas as pd
  infm=pd.read_excel('D:/data/test.xls')
  ufl=pd.read_excel('D:/data/test1.xls')
  
  for row in infm.iterrows():
      a=row[1]['Name']
      b=ufl['Name'].unique().tolist()
      for i in b:
          if i==a:
              row[1]['Age']=(ufl['Age'][ufl['Name']==a]).tolist()[0]
              
  </code></pre>