Spark RDD - (Creation|Construction|Initialization)
Add the line number as a value of a tuple ?
shakespeareRDD .zipWithIndex() # to (line, lineNum) .map(lambda (l, num): '{0}: {1}'.format(num, l)) # to 'lineNum: line' .take(15))
where: