So media outlets write about Trump a lot, but how do they actually view him? In order to explore this question, we employed a technique called sentiment analysis, which takes a block of text - in our case, an article in our dataset - and assigns a polarity score to it based on the nature of its language. If a high proportion of the words carry a positive meaning, the text will be scored more positively; if more of the words are negative, the text is scored more negatively .

We used a Python text processing library with sentiment analysis capability, called TextBlob for our analysis. The following visuals are based on the polarity values (scaled from -1 to 1) extracted from our set of articles using TextBlob. Most sentiment scores on individual articles hovered between 0 and 0.2, meaning that they were deemed relatively neutral. Given that we're analyzing a large batch of news articles, we think the observed impartiality makes sense.

The table below displays the raw sentiment scores derived from our data. We decided to include only opinion articles for this portion of the analysis, believing that each publication's true political "colors" would be most clearly expressed in the opinion section . Each outlet is listed below with the median sentiment it demonstrated towards each candidate over the past year. Remember, a more positive score means a more favorable treatment of a given candidate.