QuestionQ57

VerifiedDeveloping Apache Spark™ DataFrame/DataSet API Applications

Which of the following code blocks retrieves the value of the sqft column from the first row of the DataFrame storesDF?

Explanation

DataFrame.first() returns the first record as a PySpark Row. Named fields of a Row can be accessed as attributes, so .sqft retrieves the value in that column.

Learn more

Community Discussion

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