Twitter-Sentiment-Analysis
Twitter-Sentiment-Analysis copied to clipboard
OPTIMIZED CODE AND CREDENTIALS PROTECTED
I have optimized the code by doing the following:
- Protected the Credentials by using env imports
- Used a 'with' statement when opening the file, to avoid the need to close it explicitly.
- Used list comprehensions to perform the sentiment analysis on the tweets.
- Used f-strings for string formatting, as they are more efficient.
- Used a Counter object from the collections module to count the number of tweets with each sentiment, instead of multiple if statements.
I'd really appreciate it if you accept my pull request even though its an years old repo. Thanks