DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR PYTHON
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]
Source by spark.apache.org #
PREVIOUS
NEXT
Tagged:
#Return
#RDD
#elements
#satisfy
ADD COMMENT
Topic
COMMENT
Name
8+9 =
Submit