[SciPy-user] Finding Neighboors

Matthieu Brucher matthieu.brucher@gmail....
Wed Aug 1 02:08:47 CDT 2007

2007/8/1, Emanuele Zattin <emanuelez@gmail.com>:
> Hi, you might want to take a look at kd-trees. No implementation in
> scipy, but it should not be too hard to achieve. As far as i can
> remember its definition in wikipedia includes some python code. Just
> my 2 cents :)

Thank you for the link ;)
As far as I see, I did not implement a real kd-tree, I always split
dimensions in two equal parts. It is true I can make a better partition with
not much recoding (instead of splitting at the middle, I split at the
medians of the points, it can be a balanced kd-tree if the points are
uniformy reparted). I will not implement a full kd-tree with adding or
removing points, I do not have the time :(
What is more, I only implemented it for K-neighboors or Parzen Windows, and
for this, I don't need to make the tree appear in Python, everything is in
C++ (I had an implementation in Python, but it was too slow because of the
computation of the nearest zone to analyze, it is far better with a

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/scipy-user/attachments/20070801/ad8b430b/attachment-0001.html 

More information about the SciPy-user mailing list