I have a dataframe that looks like this:
ID |in_tier_1 | tier_1_location |in_tier_2 | tier_2_location
100 |1 |Sydney |0 | 0
100 |0 |0 |1 | Paris
112 |0 |0 |1 | Paris
112 |1 |NYC | |
And I want to remove duplicates but keep the non-zero values in the columns
ID |in_tier_1 | tier_1_location |in_tier_2 | tier_2_location
100 |1 |Sydney |1 | Paris
112 |1 |NYC |1 | Paris
I tried to groupby id and use the .agg() function but it is not working out. Can you please help?