Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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)]
Source by spark.apache.org #
 
PREVIOUS NEXT
Tagged: #Return #RDD #applying #function #element
ADD COMMENT
Topic
Name
6+6 =