pyspark/select

Select Columns

Select specific columns from DataFrame

pyspark
dataframe
select

Command

df.select("col1","col2")

Explanation

Retrieve one or more columns.

Examples

Select single column

df.select("name").show()