from pysparkling import Context my_rdd = Context().textFile("tests/*.py") print( "In tests/*.py: all lines={0}, with import={1}".format( my_rdd.count(), my_rdd.filter(lambda l: l.startswith("import ")).count() ) )
from pysparkling import Context my_rdd = Context().textFile('tests/*.py') print('In tests/*.py: all lines={0}, with import={1}'.format( my_rdd.count(), my_rdd.filter(lambda l: l.startswith('import ')).count()))
from pysparkling import Context my_rdd = Context().textFile('tests/*.py') unfiltered_count = my_rdd.count() filtered_count = my_rdd.filter(lambda l: l.startswith("import ")).count() print( f'In tests/*.py: all lines={unfiltered_count}, with import={filtered_count}' )
from __future__ import print_function from pysparkling import Context my_rdd = Context().textFile('tests/*.py') print('In tests/*.py: all lines={0}, with import={1}'.format( my_rdd.count(), my_rdd.filter(lambda l: l.startswith('import ')).count(), ))