Switch away from df append (#2303)

* Switch away from df append

* Update twitter_model.py

* removed comment
This commit is contained in:
Colin Delahunty
2022-08-11 14:48:15 -04:00
committed by GitHub
parent fa5e62eb50
commit 06a4f06220

View File

@@ -67,9 +67,11 @@ def load_analyze_tweets(
# Check that the API response was successful
if response.status_code == 200:
tweets = []
for tweet in response.json()["data"]:
row = get_data(tweet)
df_tweets = df_tweets.append(row, ignore_index=True)
tweets.append(row)
df_tweets = pd.DataFrame(tweets)
elif response.status_code == 401:
console.print("Twitter API Key provided is incorrect\n")
return pd.DataFrame()