+1 for sklearn nearest neighbor algorithms. scipy has a good kdtree too.