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

The code block shown below should return a new DataFrame where rows in DataFrame storesDF containing at least one missing value have been dropped. Choose the response that correctly fills in the numbered blanks within the code block to complete this task.

Code block:

StoresDF.__1__.__2__(__3__ = __4__)

    Correct Answer: D

    To return a new DataFrame where rows in DataFrame storesDF containing at least one missing value have been dropped, the correct method and parameters used should be `.na.drop(how='any')`. This syntax leverages the `drop` method from the `na` accessor of the DataFrame, specifically indicating that rows with any missing value should be dropped. The word `how` specifies the condition for dropping. Therefore, the correct response is: 1. na 2. drop 3. how 4. 'any'.

Discussion
Sowwy1Option: D

D. 1. na 2. drop 3. how 4. "any"