QuestionQ13

VerifiedDeveloping Apache Spark™ DataFrame/DataSet API Applications

Which of the following code blocks returns a new DataFrame in which column sqft from DataFrame storesDF has its missing values replaced with the value 30,000?

A sample of DataFrame storesDF is shown below:

Question Image

Explanation

Spark Scala’s DataFrameNaFunctions.fill returns a new DataFrame and provides an overload that takes a numeric replacement value together with Seq[String] column names. Supplying 30000 and Seq("sqft") therefore replaces null numeric values only in sqft.

Learn more

Community Discussion

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