title: Fill pandas dataframe rows from values in another dataframe rows
body: <p>I have two pandas dataframes as given below:  </p>
  
  <p>df1</p>
  
  <pre><code>Name   City        Postal_Code     State
  James  Phoenix        85003         AZ
  John   Scottsdale     85259         AZ
  Jeff   Phoenix        85003         AZ
  Jane   Scottsdale     85259         AZ
  </code></pre>
  
  <p>df2</p>
  
  <pre><code>Postal_Code       Income       Category
    85003            41038         Two
    85259            104631        Four
  </code></pre>
  
  <p>I would like to insert two columns, <code>Income</code> and <code>Category</code>, to <code>df1</code> by capturing the values for <code>Income</code> and <code>Category</code> from <code>df2</code> corresponding to the <code>postal_code</code> for each row in <code>df1</code>.</p>
  
  <p>The closest question that I could find in SO was this - <a href="https://stackoverflow.com/questions/32019437/fill-dataframe-row-values-based-on-another-dataframe-rows-values-pandas">Fill DataFrame row values based on another dataframe row&#39;s values pandas</a>. But, the pd.merge solution does not solve the problem for me. Specifically, I used</p>
  
  <pre><code>pd.merge(df1,df2,on='postal_code',how='outer')
  </code></pre>
  
  <p>All I got was <code>nan</code> values in the two new columns. Not sure whether this is because the no of rows for <code>df1</code> and <code>df2</code> are different. Any suggestions to solve this problem?</p>