numpy to deal with knn