Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在python中,如何在2d数组中将列索引号显示为字母表?_Python_Arrays_List_2d - Fatal编程技术网

在python中,如何在2d数组中将列索引号显示为字母表?

在python中,如何在2d数组中将列索引号显示为字母表?,python,arrays,list,2d,Python,Arrays,List,2d,我需要在我的程序中以字母表的形式显示列索引,比如c3,而不是2,3[a是0,因此c是2]如果您只对26个小写字符感兴趣,这将起作用: alph = 'abcdefghijklmnopqrstuvwxyz' startIndex = (2,3) endIndex = (alph[startIndex[0]], startIndex[1]) print(endIndex[0] + str(endIndex[1])) 你的意思是想像使用2d数组一样使用c3。get('c3')?只需转换c3->(2

我需要在我的程序中以字母表的形式显示列索引,比如c3,而不是2,3[a是0,因此c是2]

如果您只对26个小写字符感兴趣,这将起作用:

alph = 'abcdefghijklmnopqrstuvwxyz'
startIndex  = (2,3)
endIndex = (alph[startIndex[0]], startIndex[1])
print(endIndex[0] + str(endIndex[1]))

你的意思是想像使用2d数组一样使用
c3
。get('c3')?只需转换c3->(2,3)