Code sample - count the words in a book

In order to make this more interesting and real, I'm going to actually use the text of a real book. It's one that I wrote, so I have the rights to include it here:

Go to the download package for this book at this point, and download both the book.txt file, which contains the text of the entire book, and the word-count.py script. Place them in your SparkCourse directory:

Double-click on the word-count.py script and we'll take a look at it:

This is very simple stuff, but the key point to note here is that ...

Get Frank Kane's Taming Big Data with Apache Spark and Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.