title: find the k nearest neighbours of a point in 3d space with python numpy
body: <p>I have a 3d point cloud of n points in the format np.array((n,3)). e.g This could be something like:</p>
  
  <pre><code>P = [[x1,y1,z1],[x2,y2,z2],[x3,y3,z3],[x4,y4,z4],[x5,y5,z5],.....[xn,yn,zn]]
  </code></pre>
  
  <p>I would like to be able to get the K-nearest neighbors of each point.</p>
  
  <p>so for example the k nearest neighbors of P1 might be P2,P3,P4,P5,P6 and the KNN of P2 might be P100,P150,P2 etc etc.</p>
  
  <p>how does one go about doing that in python? </p>