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

Doesn't work with numpy arrays

Open vidstige opened this issue 2 years ago • 1 comments

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!

vidstige avatar Nov 13 '22 15:11 vidstige

This might be a bit late, but there's a fix. Change line 42, where the sorting takes place, to points = points[points[:, i].argsort()]

Source: stackoverflow magic

egnima avatar Apr 14 '24 18:04 egnima