将行追加到Google电子表格>类型错误:键必须是字符串

2024-09-30 12:33:50 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图在google电子表格中添加一行,但出现了一个错误。通常它是有效的,但现在它说:

TypeError: keys must be a string

有人知道这是什么意思吗

这是我的代码和我尝试插入的所有数据类型的打印。电子表格的numpy类型或布尔值是否有问题

for e in range(experiments):
    #types: <class 'int'>,<class 'str'>,<class 'numpy.str_'>,<class 'float'>,<class 'int'>,<class 'int'>,<class 'numpy.float64'>,<class 'numpy.float64'>,<class 'numpy.float64'>,<class 'int'>,<class 'collections.defaultdict'>,<class 'int'>,<class 'int'>,<class 'float'>,<class 'bool'>

    insertRow=[training,gameList[e],stateList[e], eps, experiments,timesteps,min_rewardList[e],maxRewList[e],total_rewList[e],currentMaxXList[e],maxXList[e],frames_stack,mb_size,learning_rate,completed_levelList[e]]
    sheet.append_row(insertRow)

Tags: numpy错误googlebekeysfloatclassint

热门问题