I have a dictionary and I want to create a list of tuples between tags. In fact, I want to make a connection between every 2 common tags that come in 2 different titles to draw a graph. How can I do this?
data = [
{
'title': 'title1', 'tags': ['tag1', 'tag2', 'tag3']
},
{
'title': 'title2', 'tags': ['tag1','tag2']
},
{
'title': 'title3', 'tags': ['tag2','tag3']
}
]
what I want:
edge_list = [(tag1,tag2),(tag2,tag3)]