I have some data that looks like this:
| id | ethnicity |
|---|---|
| 1 | white |
| 2 | south asian |
| 2 | other |
| 3 | other |
| 4 | white |
| 4 | south asian |
as seen above there is potential for an id to have two ethnicity values. How would I go about removing these 'other' rows if that id already has an entry such as "white" or "south asian" while keeping the "white" or "south asian" entry?
I have noticed there are entries which also have south asian along with a white entry
My priority would be South Asian > White > Other in terms of keeping rows
So an expected output would be
| id | ethnicity |
|---|---|
| 1 | white |
| 2 | south asian |
| 3 | other |
| 4 | south asian |