Skip to content

Conversation

Aalian2241
Copy link

I have optimized the code by doing the following:

  1. Protected the Credentials by using env imports
  2. Used a 'with' statement when opening the file, to avoid the need to close it explicitly.
  3. Used list comprehensions to perform the sentiment analysis on the tweets.
  4. Used f-strings for string formatting, as they are more efficient.
  5. 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

@Aalian2241 Aalian2241 changed the title optimized and safe code: Keys protected, file opening, f-strings, Cou… OPTIMIZED CODE AND CREDENTIALS PROTECTED Feb 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant