Python Gsheets insert_row正在跳过数据

问题描述 投票:0回答:1

我有一本双重嵌套的字典,其中返回的值是一个具有有关人的特征的列表。我想将列表中的每个值写入Google表格,因此使用了gspread。这是我的代码:

for person in list_id: 
    index = 2

    for key, value in enrich_dict.items():

        for keytwo, valuetwo in value.items():
            row = [valuetwo[0], valuetwo[1], valuetwo[2], valuetwo[3], person] 
            sheet.insert_row(row, index)
            index += 1

出于某种原因,valuetwo [3]从未插入到工作表中,我仅获得4列数据。无论我使用什么数据测试(尝试使用简单的字符串),通常都是这样,第4个值将被跳过。

python gspread
1个回答
0
投票

您可以发表输入和预期输出的示例吗?

© www.soinside.com 2019 - 2024. All rights reserved.