How can I update a value of a df based on another df, changing the old values that are not present in the new df? I have df1 (old) and df2 (update), and would like to produce the Desired outcome.
df1 (old)
| ID | iso_pres |
|---|---|
| 1504a | 1 |
| 1504b | 1 |
| 1504c | 1 |
| 1705a | 1 |
| 1705b | 1 |
df2 (update)
| ID | iso_pres |
|---|---|
| 1504b | 1 |
| 1705a | 1 |
| 1705b | 1 |
Desired outcome
| ID | iso_pres |
|---|---|
| 1504a | 0 |
| 1504b | 1 |
| 1504c | 0 |
| 1705a | 1 |
| 1705b | 1 |