I'm using UTF-8 encoding to write my text data to a CSV file. But the csv document contains some really weird characters like,
\n\n#\xd9\x83\xd8\xb4\xd9\x85\xd9\x8a\xd8\xb1_\xd8\xaa\xd8\xb0\xd8\xa8\xd8\xad_\xd9\x88\xd9\x83\xd8\xaa\xd8\xa7\xd8\xb1\xd8\xa7_\xd8\xaa\xd8\xad\xd8\xaa\xd9\x81\xd9\x84 \n.
How do I fix this?
i changed
pd.read_csv('filename.csv')
to
pd.read_csv('filename.csv', encoding='utf-8').
it did not work.
My current code:
for tweet in tweepy.Cursor(api.search, q="#pewdiepie-filter:retweets",count=5000, lang="en",tweet_mode="extended").items():
print (tweet.created_at, tweet.full_text)
csvWriter.writerow([tweet.created_at, tweet.full_text])
Thanks, Samuel Duraivel