Google News
logo
PySpark - Quiz(MCQ)
Which of the following is used to rename a column in a PySpark DataFrame?
A)
rename()
B)
column()
C)
withColumn()
D)
renameColumn()

Correct Answer :   rename()


Explanation : rename() is used to rename a column in a PySpark DataFrame. It renames the specified column to a new name. Other DataFrame operations in PySpark include withColumn(), withColumnRenamed(), and drop().

Advertisement