title: Removing specific nodes and adjusting node number in a graph in Python
body: <p>I have a list of <code>nodes</code>. I want to remove <code>T</code> from <code>nodes</code> and update the node number. The expected output is presented.</p>
  <pre><code>nodes={(0, 0): 1,
   (0, 1): 2,
   (0, 2): 3,
   (1, 0): 4,
   (1, 1): 5,
   (1, 2): 6,
   (2, 0): 7,
   (2, 1): 8,
   (2, 2): 9}
  
  T=[(2, 0),(2,1)]
  </code></pre>
  <p>The expected output is</p>
  <pre><code>newnodes={(0, 0): 1,
   (0, 1): 2,
   (0, 2): 3,
   (1, 0): 4,
   (1, 1): 5,
   (1, 2): 6,
   (2, 2): 7}
  
  </code></pre>