O'Reilly logo
  • Som DUBEY thinks this is interesting:

sum_of_squares=sum([pow(prefs[person1][item] - prefs[person2][item],2)

From

Cover of Mastering Python for Data Science

Note

why we have not took the square root here for calculating the Euclidean distance?