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

The code block shown below should return a new DataFrame where rows in DataFrame storesDF with missing values in every column 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 with missing values in every column have been dropped, the correct option involves using the 'na' method to specify that we're dealing with NaN values, the 'drop' method to remove rows, the 'how' parameter to specify the condition, and 'all' to ensure that only rows with missing values in every column are removed. Thus, the correct code would be storesDF.na.drop(how='all').

Discussion
arullOption: B

Isn't it option B ? Result_df = storesDF.na.drop(subset="all")

Samir_91Option: D

in every column --->all any of columns --->any

Samir_91Option: D

in every column --->all any of columns --->any

jtu363Option: A

storesDF.na.drop(how="any").show()

Sowwy1Option: D

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