在Python中查看kdtree的节点

2024-04-20 04:54:17 发布

您现在位置:Python中文网/ 问答频道 /正文

我使用了下面的代码来使用python构建kd树

import random 
import kdtree
from kdtree import KDTree
import itertools
def method(size, min_, max_):
            range1 = range(min_, max_)
            range2= range(min_, max_)
            points = itertools.product(range1, range2)
            return random.sample(list(points), size)
x=method(500,0,360)
tree = KDTree.construct_from_data(x)

我用过

dir(tree)

有它的属性。 如何查看树的节点?你知道吗


Tags: fromimporttreesizerangerandomminmethod