title: Python & Pandas: How to query if a list-type column contains something?
body: <p>I have a dataframe, which contains info about movies. It has a column called <code>genre</code>, which contains a list of genres it belongs to. For example:</p>
  
  <pre><code>df['genre']
  
  ## returns 
  
  0       ['comedy', 'sci-fi']
  1       ['action', 'romance', 'comedy']
  2       ['documentary']
  3       ['crime','horror']
  ...
  </code></pre>
  
  <p>I want to know how can I query the dataframe, so it returns the movie belongs to a cerain genre?</p>
  
  <p>For example, something may like <code>df['genre'].contains('comedy')</code> returns 0 or 1.</p>
  
  <p>I know for a list, I can do things like:</p>
  
  <pre><code>'comedy' in  ['comedy', 'sci-fi']
  </code></pre>
  
  <p>However, in pandas, I didn't find something similar, the only thing I know is <code>df['genre'].str.contains()</code>, but it didn't work for the list type.</p>