python读json文件数组_如何在python中从json文件读取json对象数组
我有一個名為example.json的json文件,包含以下內容[{
"product/productId" : "XXX",
"product/title" : "14k Yellow Gold Butterfly Pendant, 16 ",
"product/price" : "unknown",
"review/userId" : "XXX",
"review/profileName" : "Disappointed Sony customer",
"review/helpfulness" : "1/1",
"review/score" : "4.0",
"review/time" : "1178150400",
"review/summary" : "pretty necklace",
"review/text" : "It is a nice made necklace, and the butterfly pendant looks beautiful. I love it.",
"numOfPositive" : "2",
"numOfNegative" : "0"
},
{ "product/productId" : "XXXX",
"product/title" : "14k Yellow Gold Butterfly Pendant, 16 ",
"product/price" : "unknown",
"review/userId" : "TTT",
"review/profileName" : "A. Thorpe Amazon lover ",
"review/helpfulness" : "1/1",
"review/score" : "4.0",
"review/time" : "1175990400",
"review/summary" : "pretty necklace",
"review/text" : "I bought this necklace on a whim; I love butterflies and it looked so dainty anadfasdfasdfd sweet. It was actually a little more weighty than I expected, although it's not a solid piece. The chain is shiny and nicer than I expected.",
"numOfPositive" : "4",
"numOfNegative" : "0"
}]
意思是-文件包含由“,”分隔的文件分配。
如何在python中分別讀取和處理每個json文檔(將其發送到rest api)?
附筆
原始文件可以有幾個GB的大容量
總結
以上是生活随笔為你收集整理的python读json文件数组_如何在python中从json文件读取json对象数组的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: java属于高级语言_一文告诉你java
- 下一篇: 全国高校食堂排行榜TOP10?!