[Solved] number of lines with number of words less than 5KiratAugust 23, 2022Solved I solved it. The problem was that I was trying to split a list. This is the new line rdd=rdd.filter(lambda line: len(line[0].split(" "))<5).collect() solved number of lines with number of words less than 5 # apache-spark# pyspark# python