6 ms·
If you're iterating over all your points calculating distances, you are going about this the wrong way. (edit) The author could use my handy python quad tree i
by Dav3xor 11y ago
If you're iterating over all your points calculating distances, you are going about this the wrong way.
(edit) The author could use my handy python quad tree if he so wishes -- https://github.com/Dav3xor/pyquadtree https://github.com/Dav3xor/pyquadtree, and if he asks nicely, I could even add support for simple approximation of spherical coordinates.
- dhenneberger 11y agoI feel like a k-d tree would be a more appropriate solution, if the programmer wanted to write more than a simple loop.
- Dav3xor 11y agoSure, absolutely. Just wanted to point out that the article isn't very sophisticated.
- jfpuget 11y agoIt is simple indeed. The performance I got was good enough to spare me the effort of using quad trees. Yes, I know what quad trees are. I even coded octrees for 3D reasoning in a previous life ;)
- deleted 11y ago[deleted]
- shoyer 11y agoIndeed, came here to say exactly this. K-d trees are even built in to SciPy, which the author probably already has installed (Scikit-Learn also has an implementation).