title: Slicing each row in a different way
body: <p>I have a <code>numpy.array</code> <code>a</code> with the shape <code>(8, 16000, 2)</code> which represents 8 stereo audios each 1s long. I want to sample a 0.5s subsample from each recording. Thus, I sample start and end indices in the following way:</p>
  <pre class="lang-py prettyprint-override"><code>a = np.random.rand(8, 16000, 2)
  possible_starts = np.arange(8000)
  start_idxs = np.random.choice(possible_starts, size=a.shape[0])
  end_idxs = start_idxs + 8000
  </code></pre>
  <p>How to extract these different slices for each row in numpy efficienty?
  I obviously can do it in loop:</p>
  <pre class="lang-py prettyprint-override"><code>b = np.zeros((8, 8000, 2))
  for i in range(a.shape[0]):
      b[i] = a[i, start_idxs[i]: end_idxs[i], :]
  </code></pre>
  <p>but I want to do it in the vectorised way.</p>