Python 将单个数组维度写入Excel工作表

Python 将单个数组维度写入Excel工作表,python,windows,openpyxl,Python,Windows,Openpyxl,如何将数组的一维写入excel工作表?我使用的是来自openpyxl文档的,但当我只指定一个维度时,它会返回一个错误 TypeError: Value must be a list, tuple, range or generator, or a dict. Supplied value is <type 'str'> 我想您不只是想附加到工作表的末尾。要使用i,j作为左上角,而不是第3行,第2列将循环替换为下面的代码,使用i代替3,使用j代替2 for r in range(le

如何将数组的一维写入excel工作表?我使用的是来自
openpyxl
文档的,但当我只指定一个维度时,它会返回一个错误

TypeError: Value must be a list, tuple, range or generator, or a dict.
Supplied value is <type 'str'>

我想您不只是想附加到工作表的末尾。要使用i,j作为左上角,而不是第3行,第2列将循环替换为下面的代码,使用i代替3,使用j代替2

for r in range(len(data)):
    ws.cell(row=r+3, column=2).value = data[r][0]
for r in range(len(data)):
    ws.cell(row=r+3, column=2).value = data[r][0]