title: Merge two data frames in Python on column with non-unique values
body: <p>I am trying to merge two dataframes in Python based on column 'X'.</p>
  
  <p>The column X in left dataframe has non-unique values and the column X in right dataframe has unique values. How can I merge the values from the right dataframe into the left dataframe?</p>
  
  <p>I want to merge rows from df2 into df1 to form df3</p>
  
  <pre><code>df1 = pd.DataFrame({'A': ['NA','EU','LA','ME'],
                      'B': [50, 23,21,100],
                      'X': ['IW233', 'IW455', 'IW455', 'IW100']})
  
  df2 = pd.DataFrame({'C': [50, 12, 12, 11, 10, 16],
                      'X': ['IW455', 'IW200', 'IW233', 'IW150', 'IW175', 'IW100'],
                      'D': ['Aug', 'Sep', 'Jan', 'Feb', 'Dec', 'Nov']})
  </code></pre>
  
  <p>df3:<a href="https://i.stack.imgur.com/GrHm9.png" rel="nofollow noreferrer">1</a></p>