Error in distance function

I tried implementing K-Means but I am getting the error "operands could not be broadcast together with shapes (2,) (500,) " for distance function. Help?