0

When I try to run my sreamlit app having function:

def get_tweets(Topic,Count):
    i=0
    #my_bar = st.progress(100) # To track progress of Extracted tweets
    for tweet in tweepy.Cursor(api.search_tweets, q=Topic,count=100, lang="en",exclude='retweets').items():
        time.sleep(0.1)
        #my_bar.progress(i)
        df.loc[i,"Date"] = tweet.created_at
        df.loc[i,"User"] = tweet.user.name
        df.loc[i,"IsVerified"] = tweet.user.verified
        df.loc[i,"Tweet"] = tweet.text
        df.loc[i,"Likes"] = tweet.favorite_count
        df.loc[i,"RT"] = tweet.retweet_count
        df.loc[i,"User_location"] = tweet.user.location
        df.to_csv("TweetDataset.csv",index=False)
        df.to_excel('{}.xlsx'.format("TweetDataset"),index=False)   ## Save as Excel
        i=i+1
        if i>Count:
            break
        else:
            pass

I get this error:

ValueError: Excel does not support datetimes with timezones. Please ensure that datetimes are timezone unaware before writing to Excel.
FlyingTeller
  • 17,638
  • 3
  • 38
  • 53
  • Does this answer your question? [ExcelWriter ValueError: Excel does not support datetime with timezone when saving df to Excel](https://stackoverflow.com/questions/61802080/excelwriter-valueerror-excel-does-not-support-datetime-with-timezone-when-savin) – FlyingTeller Mar 10 '22 at 13:23

0 Answers0