for i, j in itertools.combinations(list(range(len(s.T))), 2):
    pass
How to retrieve frequencies of the number of unique occurrences of pair letters for every possible pair of columns from a numpy matrix in python