title: How to use series.isin with different sets for different values?
body: <p>As you know I can do <code>df[df.column.isin(set)]</code> to get the part of the DataFrame where the column value is in that set. But now my source set is dependent on the value of column1. How do I make the function lookup a dictionary for the source set on the go, as it filters the dataframe?</p>
  
  <p>let's say i have </p>
  
  <pre><code>dict1={'a':[1,2,3],'b':[1,2],'c':[4,5,6]}
  </code></pre>
  
  <p>and my df looks like</p>
  
  <pre><code>column1  column2
  a        4
  b        2
  c        6
  </code></pre>
  
  <p>and the new df should look like</p>
  
  <pre><code>column1  column2
  b        2
  c        6
  </code></pre>
  
  <p>Since 4 isn't in the list that 'a' points to in dict1.</p>
  
  <p><code>new_df = df[df.column2.isin(dict1[df.column1])]</code>
  This gives me TypeError. I understand since i'm using pd.Series as keys and it's not hashable.</p>