How to select particular column in Spark(pyspark)? testPassengerId = test.select('PassengerId').map(lambda x: x.PassengerId)

I want to select PassengerId column and make RDD of it. But .select is not working. It says 'RDD' object has no attribute 'select'
You could try the following,

testPassengerID = test.select('PassengerID').rdd


this would select the column PassengerID and convert it into a rdd