title: How can I create a column with counts between a column and a list in Pandas?
body: <p>I want to create a column <code>df['score']</code> that returns the count of values in common between a cell and a list.</p>
  
  <p>Input:</p>
  
  <pre><code>correct_list = ['cats','dogs']
    answer       
  0 cats, dogs, pigs
  1 cats, dogs        
  2 dogs, pigs        
  3 cats              
  4 pigs     
  
  def animal_count(dataframe):
      count = 0
      for term in df['answer']:
          if term in symptom_list:
              df['score'] = count + 1
  
  animal_count(df)         
  
  </code></pre>
  
  <p>Intended Output:</p>
  
  <pre><code>correct_list = ['cats','dogs']
  
    answer            score
  0 cats, dogs, pigs  2
  1 cats, dogs        2
  2 dogs, pigs        1
  3 cats              1
  4 pigs              0
  
  </code></pre>
  
  <p>Any ideas? Thanks!</p>