title: isin check against a list-Pandas Dataframe
body: <p>I want to select some data from a dataframe based on a list. I have refered meany questions including <a href="https://stackoverflow.com/questions/12096252/use-a-list-of-values-to-select-rows-from-a-pandas-dataframe">this</a> one. My 'df2' is like following:</p>
  
  <pre><code>   col1 col2  session_number col3 col4  session
  0    1.1    A               0  1.1    X        1
  1    1.1    A               1  1.7    X        2
  2    1.1    A               2  2.5    Y        3
  3    2.6    B               0  2.6    Y        7
  4    2.5    B               0  3.3    Z        5
  </code></pre>
  
  <p>I want to group 'col2' and 'session' in to another dataframe.</p>
  
  <pre><code>df3 = pd.DataFrame({'count' : df2.groupby( ["col2","session"] ).size()}).reset_index()
  </code></pre>
  
  <p>so my df3 is like:</p>
  
  <pre><code>   col2  session  count
  0     A        1      1
  1     A        2      1
  2     A        3      1
  3     A        6      1
  4     B        5      1
  5     B        7      1
  </code></pre>
  
  <p>Now I want to find session values where col2='D'.(these values are not here since I have put only part of the dataframe)</p>
  
  <pre><code>li = []
  li.append(df3[df3.col2 == 'D' ]['session'].values)
  </code></pre>
  
  <p>Then I want to go back to df2 and get corresponding 'col1' values for the session values in 'li'</p>
  
  <pre><code>print df2[df2['session'].isin(li)]['col1'].unique()
  </code></pre>
  
  <p>It gives following Error.</p>
  
  <pre><code>Traceback (most recent call last):
    File "/home/nilani/Desktop/testingSessions.py", line 40, in &lt;module&gt;
      print df2[df2['session'].isin(li)]['col1'].unique()
    File "/usr/local/lib/python2.7/dist-packages/pandas-0.11.0-py2.7-linux-x86_64.egg/pandas/core/series.py", line 2785, in isin
      value_set = set(values)
  TypeError: unhashable type: 'numpy.ndarray'
  </code></pre>
  
  <p>But if I use values inside 'li' as follows it wont give any error and print the output correctly.</p>
  
  <pre><code>print df2[df2['session'].isin([ 4, 10])]['col1'].unique()
  </code></pre>
  
  <p>What is the problem here?</p>