I have a 25 by 25 matrix looks like
solution = array([[ 3, 14, 12, 6, 25, 19, 7, 21, 18, 16, 5, 24, 9, 10, 1, 13,
23, 4, 20, 8, 22, 11, 17, 15, 2],
[ 2, 9, 19, 8, 13, 12, 20, 3, 10, 11, 17, 7, 23, 15, 14, 22,
25, 18, 5, 16, 4, 21, 6, 24, 1],
[21, 18, 15, 7, 5, 4, 6, 22, 17, 1, 13, 20, 3, 11, 2, 24,
10, 14, 12, 9, 16, 8, 25, 19, 23],
...
...
[14, 13, 21, 1, 3, 17, 5, 12, 16, 15, 6, 19, 22, 4, 23, 10,
8, 24, 25, 2, 9, 20, 18, 7, 11]])
I want to convert all elements into string letters. For example, now solution[0][2]=12, and in my new solution it should be solution_new[0][2]='L'.
I've tried the following code but didn't work.
for i in rows:
for j in cols:
for k in vals:
solution[i][j] = chr(k + 64)
Is there any other function? Thanks!
list(map((lambda sol: [chr(k + 64) for k in sol]), solution))