Rescale distances in Python
Numpy op