lineList.reduceByKey(lambda accum,n: accum + n) code example Example: lineList.reduceByKey(lambda accum,n: accum + n) pairs.reduceByKey((a: Int, b: Int) => a + b)