如何使用python将excel列作为列表读取?
Excel 数据:输入文件(input.xlsx)
Column1 Column2 Column3 Column4
one two three four
22/03/1997 six 7 eight
代码
book = xlrd.open_workbook("input.xlsx")
sheet = book.sheet_by_index(0)
col = []
for i in range(1,sheet.nrows):
col.append(str(sheet.row_values(i)))
但是我的代码将按行打印,但我想按列读取数据
预期输出:
[[Column1,one,22/03/1997],[Column2,two,six],[Column3,three,7,],[ Column4,four,eight]]
慕森王
开心每一天1111
相关分类