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
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