Looking at the ratings-counter script in Canopy

So now that we have a better idea of what's actually going on here, let's take another look at the ratings-counter script as a whole. Go back to your SparkCourse directory and open it back in Canopy:

Here it is altogether, shown as follows. It looks a bit neater in here, so once again let's review what's going on here:

 from pyspark import SparkConf, SparkContext import collections conf = SparkConf().setMaster("local").setAppName("RatingsHistogram") sc = SparkContext(conf = conf) lines = sc.textFile("file:///SparkCourse/ml-100k/u.data") ratings = lines.map(lambda x: x.split()[2]) result = ratings.countByValue() ...

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.