title: How to find in a parent string list, the indexes corresponding to a child string list
body: <p>I am writing a code which reads data from a text file. I load the data using numpy <a href="https://www.google.es/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;source=web&amp;cd=1&amp;cad=rja&amp;uact=8&amp;ved=0CCEQFjAA&amp;url=http%3A%2F%2Fdocs.scipy.org%2Fdoc%2Fnumpy%2Freference%2Fgenerated%2Fnumpy.loadtxt.html&amp;ei=1RU5VdHQAYuO7AbjuIH4DQ&amp;usg=AFQjCNHn0nfFa-hFfHa_82Fnz4PssUIVlw&amp;sig2=ED4HgmHzzF1PcmdwiCtmqg&amp;bvm=bv.91427555,d.ZWU" rel="nofollow">loadtxt</a> and it could look like something like this:</p>
  
  <pre><code>import numpy as np
  
  Shop_Products  = np.array(['Tomatos', 'Bread' , 'Tuna', 'Milk', 'Cheese'])
  Shop_Inventory = np.array([12, 6, 10, 7, 8])
  </code></pre>
  
  <p>I want to check some of the products I have:</p>
  
  <pre><code>Shop_Query     = np.array(['Cheese', 'Bread']
  </code></pre>
  
  <p>Now I would like to find these "items" indeces in the Shop_Products array without doing a for loop and if checks. </p>
  
  <p>I wondered if it could be done with any of the numpy methods: I thought of using  a <a href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.intersect1d.html" rel="nofollow">intercept1d</a> to find the common items and then use <a href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.searchsorted.html" rel="nofollow">searchsorted</a>. However, I cannot sort my "Products" list since I do not want to loose the original sorting (for example I would use the indexes to directly look for the inventory of each product).</p>
  
  <p>Any advice on the "pythonish" solution?</p>