import numpy as np
import itertools
N_rows = 10
arr = np.random.random_integers(5, size=(N_rows, 12))
x = np.array([0, -1, -1, 0, 1, 1])
y = x[arr]
print(y)
score, best_sextuple = max((y[:, (cols)].sum(), cols) for cols in itertools
    .combinations(list(range(12)), 6))
print("""score: {s}
sextuple: {c}
""".format(s=score, c=best_sextuple))
Сравните несколько столбцов в массиве numpy