if G.has_edge(subject_id, object_id):
    G[subject_id][object_id]['weight'] += 1
else:
    G.add_edge(subject_id, object_id, weight=1)
return G
Updating weight information depending on repeat of edges with networkx