title: merge multiple data frames by multiple columns, Pandas, Python
body: <p>I would like to merge multiple data frames in the sequence of df3 - df2 - df1. <code>df3</code> and <code>df2</code> are merged first by <code>df3(id, Feature 1)</code> on <code>df2(id, Feature 1)</code>. However then, <code>df2(id, Feature 2)</code> and <code>df1(id, Feature 2)</code> are merged together. The output would look like:</p>
  <p><a href="https://i.stack.imgur.com/zU8Gg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zU8Gg.png" alt="enter image description here" /></a></p>
  <p>Here is my code:</p>
  <pre><code>import pandas as pd
  
  data1 = {
      'id': ['1', '2', '3', '4', '5'],
      'Feature1': ['K', 'C', 'E', 'G', 'I'],
      'Feature2': ['L', 'N', 'F', 'H', 'J']}
  
  df1 = pd.DataFrame(data1, columns = ['id', 'Feature1', 'Feature2'])
  
  data2 = {
      'id': ['1', '2', '6', '7', '8'],
      'Feature1': ['K', 'M', 'O', 'Q', 'S'],
      'Feature2': ['L', 'N', 'P', 'R', 'T']}
  df2 = pd.DataFrame(data2, columns = ['id', 'Feature1', 'Feature2'])
  
  data3 = {
      'id': ['1', '2', '3', '4', '5', '7', '8', '9', '10', '11'],
      'Feature1': ['K', 'M', 'O', 'Q', 'S','X','Y','Z','W','P'],
      'Feature2': ['B', 'D', 'F', 'H', 'J','O', 'Q', 'S','X','Y'],
      'Feature3': [12, 13, 14, 'K', 'M','S', 'Q',15, 16, 17,]}
  
  
  df3 = pd.DataFrame(data3, columns = ['id', 'Feature1', 'Feature2','Feature3'])
  </code></pre>
  <p><code>df1</code>, <code>df2</code>, and <code>df3</code> are shown in the figure above.</p>
  <p>Could I ask how to do it? Thanks!</p>