Python 使用Pandas和Tweepy,我需要逐行读取tweets的json文件吗

Python 使用Pandas和Tweepy,我需要逐行读取tweets的json文件吗,python,pandas,tweepy,Python,Pandas,Tweepy,我有以下代码将tweet保存到json文件 for tweets in tweepy.Cursor(api.user_timeline, id=account).items(1000): # depending on where the supports club are home or away if tweets.created_at >= EarliestTweet: #Write

我有以下代码将tweet保存到json文件

            for tweets in tweepy.Cursor(api.user_timeline, id=account).items(1000):
            # depending on where the supports club are home or away
            if tweets.created_at >= EarliestTweet:
                #Write it to a file
                json.dump(tweets._json,jsonfile, sort_keys = True, skipkeys = True, indent = 2,ensure_ascii=False)

使用pandas
dataframe.read_json
是否需要逐行读取json文件,或者是否可以将read_json文件名传递给pandas来创建数据帧。read_json应返回数据帧。阅读文档。

感谢您的回复。我很难知道我的json文件的格式是否正确,或者是否使用正确的参数调用read_json。在一些帖子中,我看到人们在向文件中写入tweet后添加/n。你知道tweepy的_json是否需要作为拆分、列、记录、索引或列来读取吗?你在尝试做什么,以及阻止你做什么?我的问题在上面给出了我是如何创建json文件的,我如何使用read _json将其读取到熊猫数据帧中?我需要传递什么参数来读取_json,这样tweepy json才会被读取而不会导致错误。您使用的参数取决于您希望最终输出给我的内容。只需执行
pd.read_json(这里是json)
并查看结果。如果它抛出错误,请返回并再次询问。谢谢@theamateurdataanalyst我得到了错误值error:Expected object或value您是否已经尝试使用
read\u json
,如果是,发生了什么?对于更具体的解决方案,也鼓励使用数据样本。