Google News
logo
PySpark - Quiz(MCQ)
Which of the following is used to convert an RDD to a DataFrame in PySpark?
A)
fromRDD()
B)
RDDtoDF()
C)
toDataFrame()
D)
createDataFrame()

Correct Answer :   createDataFrame()


Explanation : createDataFrame() is used to convert an RDD to a DataFrame in PySpark. It creates a DataFrame from an RDD with a specified schema. Other DataFrame operations in PySpark include select(), filter(), groupBy(), and join().

Advertisement