title: For every point in an array, find the closest point to it in a second array and output that index
body: <p>If I have two arrays:</p>
  
  <pre><code>X = np.random.rand(10000,2)
  Y = np.random.rand(10000,2)
  </code></pre>
  
  <p>How can I, for each point in X, find out which point in Y is closest to it? So that in the end I have an array showing:</p>
  
  <pre><code>x1_index   y_index_of_closest
     1               7
     2               54
     3               3
    ...             ...
  </code></pre>
  
  <p>I want to do this for both columns in X and compare each to each column and value in Y</p>