RDD.
filter
Return a new RDD containing only the elements that satisfy a predicate.
Examples
>>> rdd = sc.parallelize([1, 2, 3, 4, 5]) >>> rdd.filter(lambda x: x % 2 == 0).collect() [2, 4]
previous
pyspark.RDD.distinct
next
pyspark.RDD.first