title: Pandas Merge DataFrame Columns With Same Name But Different Rows
body: <p>I would like to merge two dataframes. Both have the same column names, but different numbers of rows.  </p>
  
  <p>The values from the smaller dataframe should then replace the values from the other dataframe</p>
  
  <p>So far I tried using pd.merge</p>
  
  <pre class="lang-py prettyprint-override"><code>pd.merge(df1, df2, how='left', on='NodeID)
  </code></pre>
  
  <p>But I do not know how to tell the merge command to use the values from the right dataframe for the columnes 'X' and 'Y'.</p>
  
  <pre class="lang-py prettyprint-override"><code>df1 = pd.DataFrame(data={'NodeID': [1, 2, 3, 4, 5], 'X': [0, 0, 0, 0, 0], 'Y': [0, 0, 0, 0, 0]})
  df2 = pd.DataFrame(data={'NodeID': [2, 4], 'X': [1, 1], 'Y': [1, 1]})
  </code></pre>
  
  <p>The result should then look like this:</p>
  
  <pre class="lang-py prettyprint-override"><code>df3 = pd.DataFrame(data={'NodeID': [1, 2, 3, 4, 5], 'X': [0, 1, 0, 1, 0], 'Y':[0, 1, 0, 1, 0]})
  </code></pre>