Return a new RDD by applying a function to each element of this RDD.
rdd = sc.parallelize(["b", "b", "c"])
sorted(rdd.map(lambda x: (x, 1)).collect())
# [('a', 1), ('b', 1), ('c', 1)]
Are there any code examples left?
New code examples in category Python