title: Updating indices into a Python list after removal of elements
body: <p>Suppose I have a list <code>x</code> of integers. I also have another two lists <code>z1</code> and <code>z2</code>, each with a separate set of indices into <code>x</code>, where no element in <code>z1</code> is equal to an element in <code>z2</code>. I want to remove all elements of <code>x</code> corresponding to the indices in <code>z1</code>, to leave a list <code>y</code>. Then, I want to update the indices in <code>z2</code> such that they correspond to the respective elements in <code>x</code> as they were before this removal.</p>
  
  <p>As an example:</p>
  
  <pre><code>x = [3, 4, 6, 8, 9, 10, 13, 14]
  z1 = [0, 5, 7]
  z2 = [1, 2, 6]
  
  y = []
  for i in x:
      if i not in z1:
          y.append(x[i])
  
  # Now I need to update the values of z2 ...
  </code></pre>
  
  <p>This should yield:</p>
  
  <pre><code>&gt;&gt; y
  [4, 6, 8, 9, 13]
  &gt;&gt; z2
  [0, 1, 4]
  </code></pre>
  
  <p>How can I do this elegantly?</p>