I have a Pandas Dataframe that look like this :
tags value
[tag1, tag2, tag3] 0
[tag2, tag3] 10
[tag1, tag3] 50
...
On this Dataframe, I want to apply a function that, for each tags of each rows, will create a new row with a column 'tag', and a column 'related_tags'. Here is an example of what I am expecting :
tag value related_tags
tag1 0 [tag2, tag3]
tag2 0 [tag1, tag3]
tag3 0 [tag1, tag2]
tag2 10 [tag3]
tag3 10 [tag2]
tag1 50 [tag3]
tag3 50 [tag1]
I am familiar with Spark DataFrames but not with Pandas, is there a simple way to achieve this ?