Data in my first RDD is like
1253 545553 12344896 1 2 1 1 43 2 1 46 1 1 53 2
Now the first 3 integers are some counters that I need to bro
First take the values using take() method as zero323 suggested
raw = sc.textfile("file.txt") headers = raw.take(3)
Then
final_raw = raw.filter(lambda x: x != headers)
and done.