I have the following problem I want to solve:
Let's say I have a datafram which looks like this
match 0 1 2 3 4 5 6 7
1 Morocco France Morocco NaN NaN NaN NaN NaN
2 Morocco France Morocco NaN NaN NaN NaN NaN
3 Morocco France NaN NaN NaN NaN NaN NaN
4 China United States NaN NaN NaN NaN NaN NaN
5 China NaN NaN NaN NaN NaN NaN NaN
I'm looking for a way to find the unique Values in each row and add them to another column while dropping all NaNs.
The output should look like the following:
match 8
1 Morocco, France
2 Morocco, France
3 Morocco, France
4 China, United States
5 China
Any suggestions on how to solve this?