如何將JSON數據從input.json轉換爲output.json using Python?一般來說,用什麼數據結構來過濾JSON數據?如何使用Python過濾JSON數據?
文件:input.json
[
{
"id":1,
"a":22,
"b":11
},
{
"id":1,
"e":44,
"c":77,
"f":55,
"d":66
},
{
"id":3,
"b":11,
"a":22
},
{
"id":3,
"d":44,
"c":88
}
]
文件:output.json
[
{
"id":1,
"a":22,
"b":11,
"e":44,
"c":77,
"f":55,
"d":66
},
{
"id":3,
"b":11,
"a":22,
"d":44,
"c":88
}
]
任何指針將不勝感激!
你有沒有考慮詞典? :d – Adib