gpt4 book ai didi

Error occurs when updating values of a nested dictionary in DolphinDB(更新DolphinDB中嵌套字典的值时出错)

转载 作者:bug小助手 更新时间:2023-10-24 17:55:18 30 4
gpt4 key购买 nike



As shown in the following script, I want to update values of a nested dictionary “d2“:

如以下脚本所示,我希望更新嵌套字典“D2”的值:


d1 = dict( STRING, ANY )
d2 = dict( STRING, ANY )
d2[`d2_K] = 1
d1[`d1_K] = d2
d1[`d1_K][`d2_K] = 3

But when I executed the last line of code, I encountered an error: Please use '==' rather than '=' as equal operator in non-sql expression.

但是当我执行最后一行代码时,我遇到了一个错误:请在非SQL表达式中使用‘==’而不是‘=’作为等于运算符。


I tried an alternative approach:

我尝试了另一种方法:


d1 = dict( STRING, ANY )
d2 = dict( STRING, ANY )

d2[`d2_K] = 1
d1[`d1_K] = d2
d2[`d2_K] = 3

But another error was reported: Object without ownership could not be modified.

但报告了另一个错误:无法修改没有所有权的对象。


Could someone explain the causes behind these errors?

谁能解释一下这些错误背后的原因?


更多回答
优秀答案推荐


  1. The first error occurs because assignment operation is not supported
    in d1[d1_K][d2_K] = 3.

  2. The second error occurs because “d2[`d2_K]” is read-only and cannot
    be modified.


更多回答

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com