I am curious as to why the following cdist
differ so much in time even though they produce the same results:
import numpy as np
from scipy.spatial.distance import cdist
x = np.random.rand(10_000_000, 50)
y = np.random.rand(50)
result_1 = cdist(x, y[np.newaxis, :])
result_2 = cdist(x, y[np.newaxis, :], `minkowski`, p=2.)
The result_1
is significantly faster than result_2
.