title: Find whether a numpy array is a subset of a larger array in Python
body: <p>I have 2 arrays, for the sake of simplicity let's say the original one is a random set of numbers:</p>
  
  <pre><code>import numpy as np
  a=np.random.rand(N)
  </code></pre>
  
  <p>Then I sample and shuffle a subset from this array:</p>
  
  <pre><code>b=np.array()  &lt;------size&lt;N
  </code></pre>
  
  <p>The shuffling I do do not store the index values, so b is an unordered subset of a</p>
  
  <p>Is there an easy way to get the original indexes of b, so they are in the same order as a, say, if element 2 of b has the index 4 in a, create an array of its assignation.</p>
  
  <p>I could use a for cycle checking element by element, but perhaps there is a more pythonic way</p>
  
  <p>Thanks</p>