I have n points with me and I have to compute the euclidean distance between each point and the remaining n-1 points. I have used the following way to do it in python:
for eachRow in range(0, numberOfPoints):
distanceProximityMatrix.append([])
print('Initialisation Completed')
for i in range(0, numberOfPoints):
if(i%100 == 0) : print('.', end = '')
for j in range(i, numberOfPoints):
if(i != j):
tempDist = distanceForMultivariate(recordsList[i], recordsList[j], attributesToBeUsed, isFirstColumnID = isFirstColumnID)
distanceProximityMatrix[i].append(tempDist)
distanceProximityMatrix[j].append(tempDist)
else :
distanceProximityMatrix[i].append(0)
Is there any faster way to do this as the number of points I am having is quite large and this strategy takes a large amount of time.
Note : The distanceForMultivariate function calculates the euclidean distance.