title: Using KDTree.query
body: <p>So I'm trying to run a nearest neighbor search and am starting off keeping it really simple. My array:</p>
  
  <pre><code>array = [([0, 0], 
            [0, 1],
            [2, 1])]
  </code></pre>
  
  <p>Then my code:</p>
  
  <pre><code>tree = spatial.KDTree(array)
  
  dist, indices = tree.query(array)
  print dist
  print indices
  </code></pre>
  
  <p>What I can't understand is my output. My output is:</p>
  
  <pre><code>[0. 0. 0.]
  [0 1 2]
  </code></pre>
  
  <p>Which I don't understand how it related to my system. The doc for query is <a href="https://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.spatial.KDTree.query.html" rel="nofollow noreferrer">here</a></p>