Exam Certified Associate Developer for Apache Spark All QuestionsBrowse all questions from this exam
Question 116

The code block shown below should return a DataFrame containing all columns from DataFrame storesDF except for column sqft and column customerSatisfaction. Choose the response that correctly fills in the numbered blanks within the code block to complete this task.

Code block:

__1__.__2__(__3__)

    Correct Answer: C

    To drop columns from a DataFrame in Python (commonly using pandas or PySpark), you need to call the DataFrame's drop method and specify the labels of the columns to be removed. The correct syntax involves calling 'storesDF.drop' and passing the column names as a list of strings. Thus, the appropriate way to execute this code block is 'storesDF.drop("sqft", "customerSatisfaction")'.

Discussion
SaiPavan10Option: C

C is the right choice

Sowwy1Option: C

It's C