title: How to subset pandas DataFrame whose column values are lists?
body: <p>I have a pandas DataFrame <code>df</code> that looks like this:</p>
  
  <pre><code>A      B
  0  ['a','b']
  1  ['c','d']
  2  ['a','c']
  3  ['b','d']
  4  ['a','d']
  </code></pre>
  
  <p>Now, I wish to subset <code>df</code> by only selecting those rows in which <code>'a'</code> belongs to the list in <code>B</code>, the desired output being:</p>
  
  <pre><code>A      B
  0  ['a','b']
  2  ['a','c'] 
  4  ['a','d']
  </code></pre>
  
  <p>Naively, I tried <code>df['a' in df['B']]</code>, but this doesn't seem to work. How would I go about doing this?</p>