Jabarkan ...         minDist = dist dari NumPy

>>> print('Nearest point to q: {0}'.format(points[minIdx]))

Nearest point to q: [3, 4, 4]

>>> # # # Equivalent NumPy vectorization # # #

>>> import numpy as np

>>> minIdx = np.argmin(np.linalg.norm(points-qPoint,axis=1))  # compute all euclidean distances at once and return the index of the smallest one

>>> print('Nearest point to q: {0}'.format(points[minIdx]))

Nearest point to q: [3 4 4]