Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/298.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python ValueError:使用Panda ro读取json文件时需要对象或值_Python_Json - Fatal编程技术网

Python ValueError:使用Panda ro读取json文件时需要对象或值

Python ValueError:使用Panda ro读取json文件时需要对象或值,python,json,Python,Json,我正在尝试使用Pandas读取json文件 import pandas as pd sns.set(style="whitegrid", color_codes=True) path = "../data/db_complete.log" df = pd.read_json(path, orient='records', lines=True) lift_df = df.loc[:, ["aisle", "lift_finish_retrieve_time"]] interval = 3

我正在尝试使用Pandas读取json文件

import pandas as pd


sns.set(style="whitegrid", color_codes=True)

path = "../data/db_complete.log"
df = pd.read_json(path, orient='records', lines=True)

lift_df = df.loc[:, ["aisle", "lift_finish_retrieve_time"]]
interval = 3600

df_order = df[["parent_order", "release", "shuttle_start_retrieve_time","finish_pick_time"]]

print(df.columns)
当我运行它时,会收到以下错误消息:

ValueError: Expected object or value

我已经尝试过用几种方法更改给定路径的格式,但从未奏效…

哪一行给出了该错误?请包括整个回溯。很可能是
pd。阅读json
。您的文件可能不是一个好的json文件。尝试使用
json
模块先加载它,然后从那里生成一个数据帧。我尝试先用json加载它,然后生成一个数据帧,但尽管文档确实在那里,并且我尝试了对路径的数百次输入,但我仍然以日志文件的形式打开(路径):
FileNotFoundError:[Errno 2]没有这样的文件或目录:'..\\data\\db\u complete.log'