Gradient Nearest Neighbor mapping for python