I think I need to have in the statement "from math import sqrt" and then perform a square route on the different layers, but I really wanted to see if someone could give a little help or nudge in the right direction.

Effectively I'm pretty sure I want to do the distance matrix on the data, but I don't know how to plug that in.