title: Delete rows that does not match elements in an array
body: <p>Good day!
  I'm having some problems of updating my csv file (I'm using pandas). I want the code to delete a row in the csv file if the row element is the same as my defined array</p>
  
  <p>For example if I have the following rows in my csv file:</p>
  
  <pre><code>and 2
  hi  3
  or  4
  is  5
  hello 6
  </code></pre>
  
  <p>and the defined array a is given by:</p>
  
  <pre><code>a = ['and', 'or', 'is']
  
  d = {}
  
  for k, v in reader.values:
      if a == k:
          break
      else:
          d[k] = int(v)
  </code></pre>
  
  <p>reader is the name of the variable I used to open the csv file using pandas</p>
  
  <p>I'm expecting a dictionary where the word listed in the array would not be stored in d. I'm expecting this kind of output:</p>
  
  <pre><code>{'hi':3, 'hello': 6}
  </code></pre>
  
  <p>As I checked on the output, the words listed in the array a is still included in the dictionary. I hope you could help me, thank you!</p>