【发布时间】:2020-05-06 21:47:21
【问题描述】:
我有一个 python 脚本,它使用 Get API 给我两个 json 数组
数据1
{'result': [
{'number': '0010041', 'month': 'January'},
{'number': '0010042', 'month': 'March'}
]}
数据2
{'result': [
{'task': '0010041', 'time_left': '20 sec'},
{'task': '0010042', 'time_left': '6 min'}
]}
我想使用公共条目合并两者,因此在这种情况下,它们相同的“数字”和“任务”合并数组中的其余数据。
例如。
'number': '0010041', 'month': 'January', 'time_left': '20 sec'
'number': '0010042', 'month': 'March', 'time_left': '6 min'
怎么做?
【问题讨论】: