title: pandas: merging dataframes and replacing values
body: <p>I have two dataframes:</p>
  
  <pre><code>   A = pd.DataFrame(data=np.array([['t1',1,'t2',2]]).reshape(2,2),columns=['a','b'])
  
  A
  Out[6]: 
      a  b
  0  t1  1
  1  t2  2
  
  B = pd.DataFrame(data=np.array([[1,2,3],[2,5,6],[3,6,7]]).reshape(3,3),columns=['x','y','z'])
  
  B
  Out[8]: 
     x  y  z
  0  1  2  3
  1  2  5  6
  2  3  6  7
  </code></pre>
  
  <p>I am trying to basically match columns 'x' of dataframe B  on column 'b' dataframe A but replace the matched values with column 'a' of dataframe A.</p>
  
  <p>i.e. I want to merge the two dataframes so that the output will look like this:</p>
  
  <pre><code>   x   y  z
  0  t1  2  3
  1  t2  5  6
  2  3   6  7
  </code></pre>
  
  <p>Any ideas how to go about this?</p>