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

Which of the following code blocks returns a DataFrame where rows in DataFrame storesDF containing missing values in every column have been dropped?

    Correct Answer: D

    To drop rows in a DataFrame where all columns contain missing values, you can use the `na.drop('all')` function in PySpark. This option specifies that rows will only be dropped if all values in the row are NaN. Therefore, the correct option is storesDF.na.drop('all').

Discussion
jtu363Option: D

https://spark.apache.org/docs/3.1.2/api/python/reference/api/pyspark.sql.DataFrame.dropna.html