title: pandas function with isin
body: <p>I have a dataframe as like this:</p>
  
  <pre><code>aa        bb  cc
  [a, x, y] a   1
  [b, d, z] b   2
  [c, e, f] s   3
  np.nan    d   4
  </code></pre>
  
  <p>I'm trying to create a new column like this:</p>
  
  <pre><code>aa        bb  cc dd
  [a, x, y] a   1  True
  [b, d, z] b   2  True
  [c, e, f] s   3  False
  np.nan    d   4  False
  </code></pre>
  
  <p>My current solution is:</p>
  
  <pre><code>def some_function(row):
      if row['bb].isin(row['aa'])==True:
          return True
      return False
  df['dd'] = df.apply(lambda row: some_function(row), axis=1)
  </code></pre>
  
  <p>But this throws out an error <code>("'str' object has no attribute 'isin'", 'occurred at index 0')</code></p>
  
  <p>I suspect, because I'm missing something when it comes to checking the <code>isin</code>.</p>
  
  <p>Essentially, I need to check if the str value of <code>bb</code> is in column <code>aa</code> which has a list in each cell.</p>
  
  <p>Any ideas on how to do this?</p>