Exam Certified Associate Developer for Apache Spark All QuestionsBrowse all questions from this exam
Question 155

The code block shown below contains an error. The code block is intended to return a collection of summary statistics for column sqft in Data Frame storesDF. Identify the error.

Code block:

storesDF.describes(col("sgft "))

    Correct Answer: D

    The describe() operation does not accept a Column object as an argument — the column name string 'sqft' should be specified instead. The syntax should be storesDF.describe('sqft') to compute summary statistics for the 'sqft' column.

Discussion
AhloOption: D

Answer D correct https://spark.apache.org/docs/latest/api/python/reference/pyspark.sql/api/pyspark.sql.DataFrame.describe.html