This is the end result of 537 Texas death row inmates’ last words.

You can see the source here, a morbidly fascinating website.

https://www.tdcj.state.tx.us/death_row/dr_executed_offenders.html

It is run by the Texas Department of Criminal Justice. It contains information on all people executed since 1982. This information includes their name, date of birth, crime they were convicted of, and most interesting to me, their last words.

This word cloud contains the top 150 words (with filler words removed) of the last 537 people executed by the state.The larger the word in the cloud, the more it was said.

[By filler words, I mean things like I, the, and, that, you, etc. ]

The first step was to write a program to take out all of the web links on the main page that led to the last words section. These were stored in a list. Next, I looped through the list of links, and gathered all of the <p> tags that contained the last words. These were saved to a text file. (These two steps were done using BeautifulSoup)

From there, I cleaned the data. I split each line in the text file to get to the words. I removed all punctuation, numbers, newlines, and made everything lower case (to avoid things like ‘You’ being recognized as a different word than ‘you’).

These were put into a dictionary with the appropriate counts for each word.

I then removed all words less than 3 characters and the following words: that, the, this, and, has, but, you, for, all, are, what, your, have.

After those were removed from the dictionary, the top 150 words were put into a javascript file. That was then read by a d3.js file provided to us to create the above word cloud.

For the full list of words, or the code, feel free to message me.