【发布时间】:2018-04-06 07:37:19
【问题描述】:
`例子假设这是一个json字典-
如何将其放入下面的字典中
dictionary={
"actions": [
{
"action_type": "comment",
"value": "1"
},
{
"action_type": "like",
"value": "18"
},
{
"action_type": "post",
"value": "4"
},
{
"action_type": "post_reaction",
"value": "268"
},
{
"action_type": "video_view",
"value": "198245"
},
{
"action_type": "page_engagement",
"value": "198536"
},
{
"action_type": "post_engagement",
"value": "198518"
}
],
"date_start": "2018-03-30",
"date_stop": "2018-03-30"
}
我怎么能把它变成这个我尝试了迭代器,制作函数和其他方法,但我现在卡住了
dictionary={
"comment": "1"
"like": "18"
"post": "4"
"post_reaction": "268"
"video_view": "198245"
"page_engagement": "198536"
"post_engagement": "198518"
"date_start": "2018-03-30",
"date_stop": "2018-03-30"
}`
【问题讨论】:
-
请添加您的代码以显示您尝试过的内容。
-
如果您不分享代码,我们将无法修复您的代码。
标签: python json dictionary jupyter-notebook