簡體   English   中英

我需要使用Pandas和Tweepy逐行讀取tweets的json文件嗎

[英]Using Pandas and Tweepy do I need to read a json file of tweets line by line

我有以下代碼將推文保存到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應該返回一個數據幀。 在此處閱讀文檔。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM