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

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

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

5 comments
Sign in to comment
arullOption: B
Jan 27, 2024

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

Sowwy1Option: D
Apr 10, 2024

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

jtu363Option: A
May 23, 2024

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

Samir_91Option: D
Jun 7, 2024

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

Samir_91Option: D
Jun 7, 2024

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