Guest User

Untitled

a guest
Dec 11th, 2016
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. def func(array1, array2):
  2. result = 0
  3. for x in range(len(array1)):
  4. for y in range(len(array1)):
  5. result += (array1[y, x] - array2[y, x]) * (array1[y, x] - array2[y, x])
  6. return sqrt(result)
  7.  
  8. for x, vector in enumerate(vectors_list):
  9. for entry_code_book in code_book:
  10. distance_table.append(func(vector, entry_code_book))
Advertisement
Add Comment
Please, Sign In to add comment