I have list of edges from dynamic graph as shown below
G1=nx.read_edgelist('m_enron_employees_1Sorted.txt',create_using=nx.MultiGraph(), nodetype=int)
print(G1.edges())
[(13, 48), (13, 48), (13, 48), (13, 48), (13, 48), (13, 48), (13, 48), (13, 48), (13, 48), (13, 48), (13, 48), (13, 48), (13, 48), (13, 48), (13, 48), (13, 48), (13, 48), (13, 48), (13, 48), (13, 48), (13, 48), (13, 48), (13, 48), (13, 48), (13, 48), (13, 48), (13, 48), (13, 48), (13, 48), (13, 48), (13, 48), (13, 48), (13, 48), (13, 48), (13, 48), (13, 48), (13, 48), (13, 48), (13, 48), (13, 48), (13, 48), (13, 48), (13, 48), (13, 50), (13, 50), (13, 50), (13, 50), (13, 50), (13, 50), (13, 50), (13, 50), (13, 50), (13, 50), (13, 50), (13, 50), (13, 67), (13, 67), (13, 67), (13, 67), (13, 67), (13, 67), (13, 67), (13, 67), (13, 67), (13, 67), (13, 67), (13, 67), (13, 67), (13, 67), (13, 67), (13, 67), (13, 67), (13, 67), (13, 67), (13, 67), (13, 67), (13, 67), (13, 67), (13, 67), (13, 67), (13, 67), (13, 67), (13, 67), (13, 67), (13, 67), (13, 67), (13, 67), (13, 67), (13, 67), (13, 67), (13, 67), (13, 67), (13, 67), (13, 67), (13, 67), (13, 67), (13, 67), (13, 67), (13, 67), (13, 67), (13, 67), (13, 67), (13, 67), (13, 67), (13, 147), (13, 147), (13, 147), (13, 147), (13, 147), (13, 147), (13, 147), (13, 147), (13, 147), (13, 147), (13, 147), (13, 147), (13, 147), (13, 147), (13, 147), (13, 147), (13, 147), (13, 147)]
here I want to create a occurrence matrix, which capture number of times a specific edge appear
i tried the following optiom
count=0
tempo=-1
temp1=-1
app=[]
for edge in G1.edges():
if((temp0,temp1)==(edge[0], edge[1]))
count=count +1
else:
if count!=0:
app.append((edge, count))
temp0=edge[0]
temp1=edge[1]
count=1
However, this approach is not giving correct results
Any help will be much appreciated