Advertisement
lessientelrunya

vectorisation

Jun 28th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.17 KB | None | 0 0
  1. distance = np.sqrt(np.sum((X_train - X_test)**2, axis = 1)) # Vectorization syntax
  2. print(distance)
  3. [ 3.60555128  1.80277564  2.8         3.39705755  5.83095189  4.47213595]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement