title: pandas "isin" is much slower than numpy "in1d"
body: <p>There is a huge difference between pandas "isin" and numpy "in1d" from the efficiency aspect. After some research I've noticed that the type of the data and the values that passed as parameter to the "in" method has huge impact on the run time. Anyway it looks that numpy implementation suffer much less from this problem.
  What's going on here?</p>
  
  <pre><code>import timeit
  import pandas as pd
  import numpy as np
  df = pd.DataFrame(np.random.randint(0,10,(10**6),dtype='int8'),columns=['A'])
  vals = np.array([5,7],dtype='int64')
  f = lambda: df['A'].isin(vals)
  g = lambda: pd.np.in1d(df['A'],vals)
  print 'pandas:', timeit.timeit(stmt='f()',setup='from __main__ import f',number=10)/10
  print 'numpy :', timeit.timeit(stmt='g()',setup='from __main__ import g',number=10)/10
  &gt;&gt;
  **pandas: 0.0541711091995
  numpy : 0.000645089149475**
  </code></pre>