class Distance(object):
staticmethod
def cMDistance(self,vector1,vector2,q=1):
distance=0
n=len(vector1)
for i in range(n):
distance +=pow(abs(vector1[i]-vector2[i]),q)
return round(pow(distance,1.0/q),5)
staticmethod
def cEDistance(self,vector1,vector2):
return Distance.cMDistance(self,vector1,vector2,2)