title: Most efficient way to test whether each element from one array exists in a another array, using numpy
body: <p>I would like to know the most efficient way of determining whether elements from a 1-d numpy array exist in another array.</p>
  
  <p>Specifically, I have two numpy 1-d arrays. The first is an unsorted array of integers. The second is a sorted array of target values.</p>
  
  <p>Sample input:</p>
  
  <pre><code>[45982, 124, 12, 1092, 45982, 1, 985, 299, 10092] # array 1
  
  [1, 12, 299] # array 2
  </code></pre>
  
  <p>Expected output (i.e. array 1 elements in array 2):</p>
  
  <pre><code>[False, False, True, False, False, True, False, True, False]
  </code></pre>
  
  <p>The actual arrays will be much longer: array 1 is likely to contain >5,000,000 elements, array 2 is likely to contain from 500,000 to 1,000,000 elements.</p>