def comb_index(n, k):
    count = comb(n, k, exact=True)
index = np.fromiter(chain.from_iterable(combinations(list(range(n)), k)), int,
    count=count * k)
return index.reshape(-1, k)
data = np.array([[1, 2, 3, 4, 5], [10, 11, 12, 13, 14]])
N-D version of itertools.combinations in numpy