title: Loop through a dataframe and remove element one at a time by index value
body: <p>is there a way to loop through a dataframe and remove element one at a time by index value that match values from another list. </p>
  
  <pre><code>pd.DataFrame(["apple", "john", "sam", "pols", "rock" ])
  
  
  list1 = ["1", "3", "1","1"]
  </code></pre>
  
  <p>Based on the first value on the list, I want to delete the item in the dataframe that match the index value. The first element in the list above is 1 and I want to delete the dataframe item in index 1. After the first loop my dataframe should look like this: </p>
  
  <pre><code>df = pd.DataFrame(["apple", "sam", "pols", "rock" ])
  
  
  list1 = ["1", "3", "1", "1"]
  </code></pre>
  
  <p>After the second loop: </p>
  
  <pre><code>df = pd.DataFrame(["apple", "sam", "pols"])
  
  
  list1 = ["1", "3", "1", "1"]
  </code></pre>
  
  <p>After the third loop: </p>
  
  <pre><code>df = pd.DataFrame(["apple", "pols"])
  
  
  list1 = ["1", "3", "1", "1"]
  </code></pre>
  
  <p>And go down the line for each value in the list. </p>
  
  <p>I tried to do this using the code below but I'm not getting the correct results. </p>
  
  <pre><code>for a in df.index:
      for b in list1:
          if a == b:
              drop.a
  </code></pre>
  
  <p>I'm new to python and any help or tips will be greatly appreciated! Thanks! </p>