I have two data frames of same IDs with identical structure:

```
X, Y, Value, ID

```

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.

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.

I will be glad for any example, including using numpy if you feel it is better to use for this than Pandas.

**Edit:** 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?