Databricks Certified Associate Developer for Apache Spark — Question 110

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

Answer options

Correct answer: E

Explanation

Option E is correct because it properly calls the first method on the DataFrame and then accesses the sqft property. Options A and C use incorrect syntax for accessing DataFrame values, while B accesses a row using an index which is not a valid approach for a DataFrame. Option D lacks the parentheses needed to call the first method correctly.