Yeah I think that’s for ‘two for loops’ whereby it’s the slowest of the bunch without any vectorization.
for train in range(num_train):
    for test in range(num_test):
      dists[train][test] = ((x_train[train]- x_test[test])**2).sum().sqrt()