Computational Thinking, Linear Algebra, Linear Regression, Python, Jupyter Notebook.
tmp * tmp D[i, j] = np.sqrt(d) This is very slow. For an array consisting of 1000 points in three dimensions, execution takes over 12 seconds on my machine. X = np.random.random((1000, 3)) D = np.empty((1000, 1000)) %timeit pairwise_python(X, D) 1 loops, best of 3: 12.1 s per loop Numba Version