QuestionQ54

VerifiedDeveloping Apache Spark™ DataFrame/DataSet API Applications

The code block below must return a new DataFrame in which rows from DataFrame storesDF that have missing values in every column are dropped. Choose the response that correctly fills the numbered blanks in the code block to complete this task.

storesDF.__1__.2__(3__ = __4__)  
Explanation

PySpark’s DataFrameNaFunctions.drop method removes rows containing missing values. Setting how="all" removes a row only when all of its column values are null or NaN, so storesDF.na.drop(how="all") meets the requirement. PySpark DataFrameNaFunctions.drop documentation

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!