top of page

Python code scrape Twitter sentiment for NBA teams

  • Writer: Park Daniel
    Park Daniel
  • Jun 6, 2023
  • 1 min read



  • We can perform sentiment analysis on each team using the imported module tweepy which allows us to access Twitter API and divide each tweet based on if they are positive or negative




  • This is an example of analysis sentiment for the Lakers, Warriors, Celtics, Bucks, and Rockets

  • It retrieves recent tweets mentioning team's name

  • After it calculates percentage of positive and negative sentiment using TextBlob library

Commentaires


Drop Me a Line, Let Me Know What You Think

Thanks for submitting!

© 2023 by Train of Thoughts. Proudly created with Wix.com

bottom of page