Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/309.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 Twitter API:搜索30天_Python_Twitter_Twitterapi Python - Fatal编程技术网

Python Twitter API:搜索30天

Python Twitter API:搜索30天,python,twitter,twitterapi-python,Python,Twitter,Twitterapi Python,我试图为我的代码创建一个数据框,但当我运行它时,我只得到一个空的列/行 # This grabs the search of all specified tweets within 30 days choice = input("Enter the hashtag: ") tweets = tweepy.Cursor(api.search_30_day, environment_name = "AMC", query = choice).items(1

我试图为我的代码创建一个数据框,但当我运行它时,我只得到一个空的列/行

# This grabs the search of all specified tweets within 30 days

choice = input("Enter the hashtag: ")

tweets = tweepy.Cursor(api.search_30_day, environment_name = "AMC", query = choice).items(100)

j = 1
for tweet in tweets: 
    if tweet.lang == "en":
        print(str(j) + ") " + tweet.text + "\n")
        j = j + 1



# Create a dataframe with a column called Tweets FOR SEARCH_30_DAYS
    
    df = pd.DataFrame( [tweet.full_text for tweet in tweets], columns = ["Tweets"])
    df.head()