X = np.random.randn(100, 3)
Y = np.random.randn(10, 3)
tree1 = cKDTree(X)
tree2 = cKDTree(Y)
indices = tree2.query_ball_tree(tree1, r=4.2)
Efficiently checking Euclidean distance for a large number of objects in Python