I would use a dictionary, and make use of the modulo operator. Something like this:
The modulo operator % gives the remainder of a certain division. So 0 % 12 = 0, 1 % 12 = 1, 2 % 12 = 2, ... , 12 % 12 = 0, 13 % 12 = 1, 14 % 12 = 2, etc.
The outermost braces {} turn it into a dictionary. The keys are 'A1', 'A2', etc. and the values are 1, 2, 3, 4...
P.S. here's my version for replicating tests
N_cols = 30 name2index = {"{}{}".format(chr(65 + int(a/12)), a%12 + 1):(a+1) for a in range(N_cols)} print(name2index) print(name2index['A1']) print(name2index['B12'])int(a/12) turns a number into an integer, dropping any decimals. So int(1/12) = 0, int(2/12) = 0, ..., int(12/12) = 1, int(13/12) = 1, etc. We can use this to get the letter.
The modulo operator % gives the remainder of a certain division. So 0 % 12 = 0, 1 % 12 = 1, 2 % 12 = 2, ... , 12 % 12 = 0, 13 % 12 = 1, 14 % 12 = 2, etc.
The outermost braces {} turn it into a dictionary. The keys are 'A1', 'A2', etc. and the values are 1, 2, 3, 4...
P.S. here's my version for replicating tests