import numpy as np a=np.arange(ord('a'),ord('z')) print(a) a=a.astype(str) for i in a: print(i,end=' ') print(int(i)-ord('a'),end=' ') a[int(i)-ord('a')]=chr(int(i)) print('\n',a) [ 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121] 97 0 98 1 99 2 100 3 101 4 102 5 103 6 104 7 105 8 106 9 107 10 108 11 109 12 110 13 111 14 112 15 113 16 114 17 115 18 116 19 117 20 118 21 119 22 120 23 121 24 ['a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 'u' 'v' 'w' 'x' 'y'] Process finished with exit code 0