I have a social network graph 'G'.
I'm trying to check that they keys of my graph are in the characteristics dataset as well. I ran this command:
for node in G.nodes():
if node in caste1.keys():
pass
else:
G = G.remove_node(node)
It shows an error RuntimeError: dictionary changed size during iteration