Databricks Certified Associate Developer for Apache Spark — Question 79
Which of the following operations can be used to return a new DataFrame from DataFrame storesDF without columns that are specified by name?
Answer options
- A. storesDF.filter()
- B. storesDF.select()
- C. storesDF.drop()
- D. storesDF.subset()
- E. storesDF.dropColumn()
Correct answer: C
Explanation
The correct answer is C, storesDF.drop(), as it effectively removes specified columns from the DataFrame. Options A and B do not provide functionality for dropping columns; A filters rows while B selects specific columns. Option D is not a valid operation in this context, and E is not a standard method for dropping columns in DataFrames.