title: Check whether elements in one array exist in another?
body: <p>I have an array of 17 million non-unique items and want to check if they exist in a set of unique items.</p>
  
  <pre><code>Large_array=[1,2, 3, 4,...17000000 ]
  Dictionary= [1,2,3,4,...15000000]
  </code></pre>
  
  <p>I tried list in operation:</p>
  
  <pre><code>[I in Dictionary for I in Large_array)]
  </code></pre>
  
  <p>and numpy's <code>isin</code> and <code>in1d</code>, but it takes it forever.</p>
  
  <pre><code>np.isin(Large_array, Dictionary)
  
  np.in1d(Large_array, Dictionary)
  </code></pre>
  
  <p>I would like to know if there is a faster way to accomplish the same thing.</p>
  
  <p>The output I need is an array of the same size as <code>Large_array</code>, with <code>result[i]</code> set to true iff <code>Large_array[i]</code> exists in <code>Dictionary</code>, and I would like a fast way to create it.</p>