I\'m trying to generate random edges between random nodes but the line of code ab=choice(G.nodes()) is generating errors.
ab=choice(G.nodes())
import networkx as nx impo
G.node usage is replaced by G.nodes from networkx version 2.4.
Hence you might come across this error if you are trying to un an old code which uses G.node as a key(s) identifier.
Replace all G.node with G.nodes or vice versa. depending on teh version you are trying to work.