I have a dataframe that looks like this:
productID | units sold | units in inventory |
---|---|---|
101 | 32 | NaN |
102 | 45 | NaN |
103 | 15 | NaN |
104 | 27 | NaN |
101 | NaN | 18 |
102 | NaN | 12 |
103 | NaN | 30 |
104 | NaN | 23 |
As you can see, the first column contains duplicates, where each instance has data in one 'data' column, but not the other 'data' column.
Is there a way to merge the rows, so the dataframe looks like this?
productID | units sold | units in inventory |
---|---|---|
101 | 32 | 18 |
102 | 45 | 12 |
103 | 15 | 30 |
104 | 27 | 23 |