I want to update the definition for my graph after removing nodes and edges however when I try to draw it again I get the error that it is missing a node, i.e. the one I removed. Here is my example code:
a = k(n) #This is a graph function which works fine returning a graph
remove_node = 54
a.remove_node(54)
nx.draw(a)
NetworkXError: The node 54 is not in the graph.