I\'ve been using spatial.cKDTree
in scipy
to calculate distances between points. It has always run very quickly (~1 s) for my typical data sets (findin
In the next release of SciPy, balanced kd-trees will be created with introselect instead of quickselect, which is much faster on structured datasets. If you use cKDTree on a structured data set such as an image or a grid, you can look forward to a major boost in performance. It is already available if you build SciPy from its master branch on GitHub.