How to print only a certain column of DataFrame in PySpark?

Viewed 85289

Can one use the actions collect or take to print only a given column of DataFrame?

This

df.col.collect()

gives error

TypeError: 'Column' object is not callable

and this:

df[df.col].take(2)

gives

pyspark.sql.utils.AnalysisException: u"filter expression 'col' of type string is not a boolean.;"

1 Answers
Related