【发布时间】:2021-03-13 09:22:40
【问题描述】:
{
"reviews": [
{
"reviewId": "12a3",
"authorName": "Muhammad Arifin",
"comments": [
{
"userComment": {
"text": "\tsangat terbantu????",
"lastModified": {
"seconds": "1606819245",
"nanos": 835000000
},
"starRating": 5,
"reviewerLanguage": "id",
"device": "1601",
"androidOsVersion": 23,
"appVersionCode": 20365,
"appVersionName": "5.2.73",
"deviceMetadata": {
"productName": "1601 (1601)",
"manufacturer": "Vivo",
"deviceClass": "FORM_FACTOR_PHONE",
"nativePlatform": "ABI_ARM64_V8,ABI_ARM_V7,ABI_ARM",
"cpuModel": "MT6750",
"cpuMake": "Mediatek"
}
}
},
{
"developerComment": {
"text": "Terima kasih sudah berbagi, kami sangat senang menjadi bagian dalam pejalanan travel anda!",
"lastModified": {
"seconds": "1606818598",
"nanos": 722000000
}
}
}
]
}
]
"tokenPagination": {
"nextPageToken": "abc"
}
}
我希望列名称为 reviewId、authorName、userComment_text、userComment_lastModified、starRating、deviceMetadata.manufacturer、developerComment.text
我试过这个:
df=pd.json_normalize(fetch_reviews_response, record_path="reviews")
但它只创建 reviewId、authorName 和 cmets 列
【问题讨论】: