title: Compare rows of 2 pandas data frames by column and keep bigger and sum
body: <p>I have two data frames of same IDs with identical structure:</p>
  
  <pre><code>X, Y, Value, ID
  </code></pre>
  
  <p>The only difference between the two should be values in column Value - it may need to be sorted by ID first so both have same order of rows to make sure.</p>
  
  <p>I want to compare these two data frames by row based on column Value and keep the row from first or second depending where the Value is bigger. I would also like to see example how to add additional column SUM for sum of Value columns from both data frames.</p>
  
  <p>I will be glad for any example, including using numpy if you feel it is better to use for this than Pandas.</p>
  
  <p><strong>Edit:</strong> I just realized after testing the example from the first answer that the data frames I have are missing completely the rows with ids where Value was null. That makes two data frames of different number of rows. So could be please also included how to make them same size before comparison - adding rows with missing ids from each other with IDs and zeros?</p>