title: Find k nearest neighbors
body: <p>I have a matrix</p>
  
  <pre><code>a = np.array([[ 8.6569141 ,  8.19847655,  7.83540289,  8.49673563],
                [ 7.86962825,  9.16869072,  8.60084933,  8.91840291],
                [ 9.61896688,  9.69620637,  9.1879124 ,  9.87479709],
                [ 9.17427532,  8.98877464,  8.4313078 ,  7.81914999]])
  </code></pre>
  
  <p>I saw this code to obtain the indices of k nearest neighbors:</p>
  
  <pre><code>k = 1
  index = a.argsort()[:, :k]
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>array([[2],
         [0],
         [2],
         [3]])
  </code></pre>
  
  <p>Could someone provide an explanation on these output indices?</p>