问题 For each observation in X (there are 20) I want to get the k(3) nearest neighbors. How to make this fast to support up to 3 to 4 million rows? Is it possible to speed up the loop iterating over the elements? Maybe via numpy, numba or some kind of vectorization? A naive loop in python: import numpy as np from sklearn.neighbors import KDTree n_points = 20 d_dimensions = 4 k_neighbours = 3 rng = np.random.RandomState(0) X = rng.random_sample((n_points, d_dimensions)) print(X) tree = KDTree(X,