Python-KD-Tree icon indicating copy to clipboard operation
Python-KD-Tree copied to clipboard

A simple and fast KD-tree for points in Python for kNN or nearest points. (damm short at just ~60 lines) No libraries needed.

Results 5 Python-KD-Tree issues
Sort by recently updated
recently updated
newest added

I'm getting `sort` got unexpected keyword argument `key`. I don't think numpy rows can be sorted like that. Looks like an awesome library otherwise!

First : thanks a lot of the excellent script. It's fast and concise. If you're interested, here's a basic example of using your KD-Tree with geolocalized data. ``` from kd_tree...

When sorting a numpy array, it crashes because the default numpy sort doesn't support a custom key function. This commit fixes that without directly importing numpy. See Issue #7

Hi, there seems to be a bug when points share the same coordinates. See the following example: tree = KDTree([(7, 3), (5, 3), (2, 3)], 2) print(tree.get_knn((5, 3), 2, False))...

fix sort with np.ndarray fix warning 'np.bool_' scalars to be interpreted as an index