我有两个数据集。。主数据.txt
{"id":"foo", "some_field:12354, "score":0}
{"id":"foobar", "some_field:12354, "score":0}
得分数据.txt
{"id":"foo", "score":1}
{"id":"foobar","score":20}
....
所以在主数据中。。分数初始化为0。。也。。主数据和分数数据有一些共同的ID。。
对于常见的id:我想用score\u数据中的score替换main\u数据中的“score”
如果元素不存在。。然后我想让分数为0。。
1条答案
按热度按时间pb3s4cty1#
为什么要将“score”初始化为0?你可以跳过它,加入
main_data
(左外侧)和score_data
. 无论您是否跳过,这都应该起作用: