This article will analyze the Big Five personality trait of Donald Trump and discover the changes in his personality during three periods: before the presidential election, from election to his inauguration, and after his inauguration.

The analysis is based on all public tweets of realDonaldTrump until 2020/08/09, starting with the first Tweet on 2009/05/04. We will use Pandas to read data, preprocess_kgptalkiefor data preprocessing, Watson Personality Insights API for personality analysis, Seaborn and iPlotter for data visualization, all are running on Jupyter Notebook.

The final output:

Step 1: Get Full Archive of Trump Tweets

If you have applied for a developer account to access Twitter APIs, the Search APIs can be used toexplore a user’s Tweets. However, a Standard Search API can only allow us to retrieve Tweets from the past seven days.

It’s the same in Tweepy. Tweepy is a Python library for accessing the Twitter API, the API.search_full_archivealso requires a premium environment.

In our case, we need all public tweets from Trump’s Twitter. Thanks to the Trump Twitter Archive, we can get the full archive of Trump’s tweets for free!

#donald-trump #sentiment-analysis #twitter-analysis #data-visualization #data-science

Analyze 50000 Tweets with Watson Personality Insights API and Visualize with Radar Chart
2.55 GEEK