python/pyspark/rdd.py
def filter(self, f):
        """
        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]
        """
        def func(iterator): return ifilter(f, iterator)
        return self.mapPartitions(func)

        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]
        
Return a new RDD containing only the elements that satisfy a predicate.
Return a new RDD containing only the elements that satisfy a predicate .
def filter(self, f):
        def func(iterator): return ifilter(f, iterator)
        return self.mapPartitions(func)
def filter ( self , f ) : def func ( iterator ) : return ifilter ( f , iterator ) return self . mapPartitions ( func )
Return a new RDD containing only the elements that satisfy a predicate.
Return a new RDD containing only the elements that satisfy a predicate .
"""
        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]
        """
self
f