【发布时间】:2023-02-16 23:22:28
【问题描述】:
我想为数据框的每一行填充以下 json 数组
JSON数组
"techniques": [
{
"techniqueID": "",
"tactic": "",
"color": "",
"comment": "",
"enabled": true,
"metadata": [],
"links": [],
"showSubtechniques": false
}
]
数据框
techniqueID Value color tactic
0 T1078 13 #74c476 Defense-Evasion
1 T1078 13 #74c476 Initial-Access
2 T1078 13 #74c476 Persistence
3 T1078 13 #74c476 Privilege-Escalation
4 T1110 5 #74c476 Credential-Access
5 T1070 3 #a1d99b Defense-Evasion
6 T1059 3 #a1d99b Execution
7 T1114 3 #a1d99b Collection
8 T1098 3 #a1d99b Persistenc
我试图将 json 转换为数据框并将两者结合起来,但这不会为每一行创建一个数组。
【问题讨论】:
标签: json python-3.x pandas dataframe