【发布时间】:2018-09-11 00:23:46
【问题描述】:
我尝试解析以下 json 结构:
[
{
"id": 0,
"cuisine": "greek",
"ingredients": [
"romaine lettuce",
"black olives",
"feta cheese crumbles"
]
},
{
"id": 1,
"cuisine": "southern_us",
"ingredients": [
"plain flour",
"ground pepper",
"milk",
"vegetable oil"
]
}....]
这个 JSON 文件中有数千个值,我想将其解析为 panda 数据帧。考虑到成分键下有一个嵌套列表,我将如何去做。
干杯:)
【问题讨论】:
-
解析文件应该产生一个基本的python数据结构——一个字典列表等。导入
json模块并使用它的load。
标签: python json pandas dataframe