Python .json—熊猫数据框中的文件:';非类型';对象没有属性';钥匙';

Python .json—熊猫数据框中的文件:';非类型';对象没有属性';钥匙';,python,json,pandas,dataframe,Python,Json,Pandas,Dataframe,我目前正在处理一些以.json格式保存的研究结果文件。 但是,我可以使用教程在Python Pandas中与其中一些人一起工作,如下所示: file = open(path, 'r') meta_df = pd.read_json(file) 对另一个.json使用相同的方法会产生: AttributeError:“非类型”对象没有属性“键” .json看起来像: [ { "reference": null, "enter_app": 16034

我目前正在处理一些以.json格式保存的研究结果文件。 但是,我可以使用教程在Python Pandas中与其中一些人一起工作,如下所示:

file = open(path, 'r')
    meta_df = pd.read_json(file)
对另一个.json使用相同的方法会产生:

AttributeError:“非类型”对象没有属性“键”

.json看起来像:

[
{
"reference": null,
"enter_app": 1603456818731,
"dummy1": 1603456925901,
"dummy2": 1603456971867,
"start_time": 1603456828542,
"end_time": null,
"entered_link": null,
"start_task": null,
"end_task": null,
"start_task2": null,
"end_task2": null,
"End_begin": null,
"End_end": null
 },
{
"test_version": "7",
"component_id": "10",
"ResultId": "2222",
"Id": "2",
"device": "desktop",
"operatingSystem": "Linux OS",
"link": "00000000",
"browser": "BrowserName = Chrome\nVersion = 80.0.3987.163",
"language": "de",
"age": null,
"gender": null
},
{
"baseline": {
  "1": 33,
  "2": 19,
  "3": 36,
  "4": 4
 },
"intermediate": {
  "1": null,
  "2": null,
  "3": null,
  "4": null
 },
"post": {
  "1": null,
  "2": null,
  "3": null,
  "4": null
 }
},
{
"begin_p": null,
"end_p": null
}
]

编辑/解析:它适用于此示例。我浏览了更多的示例列表,但旧的示例与另一个“null”有问题:例如,“{end_p”:null},null,{“test_version”:“7”,…}。

这个.json看起来像:
像什么?抱歉:代码有问题吗?你的代码对我有效,也许你在将文件发送给pd之前对它做了些什么?json解析它,迭代抛出它?你说得对。它适用于这个例子。我浏览了更多的示例列表,但旧的示例有另一个“null”问题:例如…“End_End”:null},null,{“test_version”:“7”。。。