Python 将嵌套数据从json文件导入熊猫

Python 将嵌套数据从json文件导入熊猫,python,json,pandas,Python,Json,Pandas,我有一个生成的文件,如下所示: [{"intervals": [{"overwrites": 35588.4, "latency": 479.52}, {"overwrites": 150375.0, "latency": 441.1485001192274}], "uid": "23"}] graph = df[['latency']] graph.plot(title="latency") 出于空间原因,我对文件进行了一些简化(除了“覆盖”和“延迟”之外,还有更多的列)。我想将数据导入一

我有一个生成的文件,如下所示:

[{"intervals": [{"overwrites": 35588.4, "latency": 479.52}, {"overwrites": 150375.0, "latency": 441.1485001192274}], "uid": "23"}]
graph = df[['latency']]
graph.plot(title="latency")
出于空间原因,我对文件进行了一些简化(除了“覆盖”和“延迟”之外,还有更多的列)。我想将数据导入一个数据帧,以便稍后绘制延迟。我尝试了以下方法:

with open(os.path.join(path, "my_file.json")) as json_file:
   curr_list=json.load(json_file)   
    df=pd.Series(curr_list[0]['intervals'])

print df 
它返回:

0{u'overwrites':35588.4,u'latency…

1{u'overwrites':150375.0,u'latency…

但是,我无法将df存储在允许我访问延迟字段的数据结构中,如下所示:

[{"intervals": [{"overwrites": 35588.4, "latency": 479.52}, {"overwrites": 150375.0, "latency": 441.1485001192274}], "uid": "23"}]
graph = df[['latency']]
graph.plot(title="latency")
有什么想法吗? 谢谢您的帮助!

我想您可以使用: