title: Find subarrays that match condition in numpy
body: <p>Suppsoe I have an array of size 10:</p>
  <pre><code>x = np.linspace(0.1, 1, 10)
  </code></pre>
  <p>I have an array of function values at these x's:</p>
  <pre><code>fx = np.sin(x)
  </code></pre>
  <p>Now I have a subarray of <code>x</code>, say, for example,</p>
  <pre><code>sub_x = x[::2]
  </code></pre>
  <p>How do I extract the values of <code>fx</code> at the sub-points in <code>sub_x</code>? I.e.,</p>
  <pre><code>fx[indices of x that are in sub_x]
  </code></pre>
  <p>This does not work: <code>fx[x == sub_x]</code>.</p>