下面是來自類似輸入的大文件的示例輸入。如何合併兩個詞典與Python中的字典?
{
"V-Su7890": [
[
{
"url": "www.talent.com",
"tid": "V-Su7890",
"id": "58ff787ffbad487b2c",
"company_name": "Talent Ltd"
}
],
[
{
"socials": ["facebook", "linkedin", "twitter"],
"title": "title of the pag",
"contact": ["+9563802140"],
"email": "email_id1"
},
{
"socials": ["facebook", "twitter", "linkedin"],
"title": "next title of the page",
"contact": ["+919765983442"],
"email": "email_id2"
}
]
]
}
我不得不當前詞典的第二列表的所有分字典合併成一個字典沒有重複的值,然後存入字典作爲一個值鍵「V-Su7890」。
所需的輸出是:
{
"V-Su7890": [
[
{
"url": "www.talent.com",
"tid": "V-Su7890",
"id": "58ff787ffbad487b2c",
"company_name": "Talent Ltd"
}
],
[
{
"socials": ["facebook", "linkedin", "twitter"],
"title": ["title of the pag", "next title of the page"],
"contact": ["+9563802140", "+919765983442"],
"email": ["email_id","email_id2"]
}
]
]
}
請幫助我瞭解和解決這個問題。
你嘗試過什麼到目前爲止並在運行什麼問題到? – pvg