
Answer-first summary for fast verification
Answer: storesDF.na.drop("all")
The question requires dropping rows where all columns have missing values. The correct method to achieve this is by using `na.drop("all")`, which checks for rows with nulls in all columns. Option A and B are incorrect because they use the default behavior which drops rows with any null values, not necessarily all. Option C is incorrect because it specifies a subset column 'sqft', which means it only checks for nulls in that specific column, not all columns. Option D is correct as it uses `na.drop("all")` without a subset, thus checking all columns for null values. Option E is incorrect due to a syntax error in the method name (`nadrop` instead of `na.drop`).
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
Which of the following code blocks returns a DataFrame where rows in DataFrame storesDF containing null values in all columns have been removed?
A
storesDF.na.drop()
B
storesDF.dropna()
C
storesDF.na.drop("all", subset = "sqft")
D
storesDF.na.drop("all")
E
storesDF.nadrop("all")
No comments yet.