Answers for "Return a new RDD containing only the elements that satisfy a predicate."

0

Return a new RDD containing only the elements that satisfy a predicate.

rdd = sc.parallelize([1, 2, 3, 4, 5])
rdd.filter(lambda x: x % 2 == 0).collect()
# [2, 4]
Posted by: Guest on March-11-2020

Code answers related to "Return a new RDD containing only the elements that satisfy a predicate."

Python Answers by Framework

Browse Popular Code Answers by Language