title: How to find distance to kth-nearest neighbor for all the points in the data set
body: <p>Let's we have a matrix X of shape <code>(10000, 1500)</code>.
  Let we take <code>k = 9</code>.
  We want to find distance from each of the point in X to the 9th nearest point in X. </p>
  
  <p>Is there any function or Sklearn library exist for this task. </p>
  
  <pre><code>def k_nearest_distances(X, k){
  return d
  } 
  </code></pre>
  
  <p></p>
  
  <p>d should be the array of length 10000. Where each value at index <code>i</code> represents distance to k-nearest point form <code>X[i]</code>.</p>