title: applying numpy.searchsorted over multiple axes
body: <p>I'm trying to pass a 2d array of sorted values and a 1d array of values to <code>searchsorted</code> and have it return a corresponding 1d array of index values. I have to perform this operation many times, and I'm trying to find an efficient way to do so. Ultimately, I'd like to pass a 3d array of values sorted along an axis, a 2d array of values to search for and have the function return a 2d array of indices.</p>
  <p>Here is a <code>MLE</code></p>
  <pre><code>from numpy import *
  random.seed(1234)
  
  a = zeros((4,10))
  a[:,1:-1] = random.rand(4,8)
  a[:,1:-1].sort(1)
  a[:,-1] = 1.
  
  v = random.rand(4)
  
  res = array([searchsorted(a[j], v[j]) for j in xrange(4)])
  </code></pre>
  <p>where <code>res</code> should be [9, 1, 7, 6]</p>
  <p>Is there an efficient way to do this? Ideally, I'd like to avoid Cython if at all possible. If it helps, each array being searched over should have 9-10 elements, while the number of values being searched for is larger (100-1000 elements) so the 2d array being passed would have a size of 1000x10.</p>