Answers for "Return a new RDD by applying a function to each element of this RDD."

0

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)]
Posted by: Guest on March-11-2020

Code answers related to "Return a new RDD by applying a function to each element of this RDD."

Python Answers by Framework

Browse Popular Code Answers by Language