Databricks Certified Associate Developer for Apache Spark — Question 22

The code block shown below contains an error. The code block is intended to return a DataFrame containing all columns from DataFrame storesDF except for column sqft and column customerSatisfaction. Identify the error.
Code block:
storesDF.drop(sqft, customerSatisfaction)

Answer options

Correct answer: D

Explanation

The correct answer is D because the drop() function requires the column names to be provided as strings, which means they should be enclosed in quotes. The other options are incorrect as they suggest methods or operations that are not necessary or valid for the drop() function in this context.