Is there any possibility to create a new column based on the keywords list?
Keywords = ["A", "B"]
I have data like this:
Location Type
Ger A
Ger F
Ger C
Ned D
Ned A
Ned B
Aus C
US B
I would like to create a new column if the keyword exists in the Type column and if 2 keywords exist then the value should both keyword with a comma. I am having a problem because I have to check also location first and then type...
Location Type NewType
Ger A A
Ger F A
Ger C A
Ned D A,B
Ned A A,B
Ned B A,B
Aus C NaN
US B B
Is there any way other than if-else?