Calculating a distance matrix using scipy [1]