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

Certified Associate Developer for Apache Spark 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__)

Show Answer
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

1 comment
Sign in to comment
Sowwy1Option: D
Apr 10, 2024

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