title: Python, Pandas: check each element in list values of column to exist in other dataframe
body: <p>I have dataframe column with values in lists, want to add new column with filtered values from list if they are in other dataframe.</p>
  <p>df:</p>
  <pre><code>df = pd.DataFrame({'a':[1,2,5,7,9],'b':[[10,1,'xxx'],[],[1,2,3],[5],[25,27]]})
  </code></pre>
  <pre><code>**a**|**b**
  :-----:|:-----:
  1|[10, 1, 'xxx']
  2|[]
  5|[1, 2, 3]
  7|[5]
  9|[25, 27]
  </code></pre>
  <p>df2:</p>
  <pre><code>df2 = pd.DataFrame({'d':[324,21,4353,345,4535,23],'e':[5,1,23,25,25,'xxx']})
  </code></pre>
  <p>I need to add new column with filtered column <code>b</code> in <code>df</code> so that it contains lists with only elements which are in <code>df2</code> column <code>e</code>.</p>
  <p>Result:</p>
  <pre><code>**a**|**b**|**c**
  :-----:|:-----:|:-----:
  1|[10, 1, 'xxx']|[1,'xxx']
  2|[]|[]
  5|[1, 2, 3]|[1]
  7|[5]|[5]
  </code></pre>
  <p>Speed is crucial, as there is a huge amount of records.</p>
  <p>What I did for now:</p>
  <ol>
  <li>created a set of possible values</li>
  </ol>
  <pre><code>l = list(df2['e'].unique())  
  </code></pre>
  <ol start="2">
  <li>Try to use <code>df.assign</code> with comprehensive lists, but it's not quite working and too slow.</li>
  </ol>
  <pre><code>df.assign(mapped=[[x for x in row if x in l] for row in df.b])
  </code></pre>
  <p>Appreciate any help.</p>
  <h3>UPD</h3>
  <p>In lists and df2 not always integer values, sometimes it's strings.</p>