i am new to programming and trying to learn python. pardon me if this sounds silly. i am trying to compare two columns in a dataframe and match the values based on the first column(used as reference). when the values in first column are not available in second or third columns, then i need to enter an NaN. could anyone helpme out how to do this? please look at the input and expected output below
Input dataframe:
| index | A | B | C |
|---|---|---|---|
| 0 | 290 | 390 | 160 |
| 1 | 390 | 450 | 290 |
| 2 | 160 | 290 | NaN |
| 3 | 450 | NaN | 450 |
Expected Output
| index | A | B | C |
|---|---|---|---|
| 0 | 290 | 290 | 290 |
| 1 | 390 | 390 | NaN |
| 2 | 160 | NaN | 160 |
| 3 | 450 | 450 | 450 |