features = list(dataframe)
distances = [[None] * 17000] * 17000

def sum_diff():
    for i in range(17000):
        for j in range(17000):
            for k in range(300):
                diff = features[i][k] - features[j][k]
diff = diff * diff
sumsquares = sumsquares + diff
distances[i][j] = sumsquares
Сумма разностей квадратов между каждой комбинацией строк матрицы 17 000 на 300