Skip to content

Instantly share code, notes, and snippets.

@rvaghefi
Last active January 13, 2021 20:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rvaghefi/6383442b5c95beec5025ef2c30a57760 to your computer and use it in GitHub Desktop.
Save rvaghefi/6383442b5c95beec5025ef2c30a57760 to your computer and use it in GitHub Desktop.
numpy_vectorized.py
def numpy_vectorized(X,Y):
return np.sum((X[:,None,:] - Y[None,:,:])**2, axis=2)**0.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment