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

Certified Associate Developer for Apache Spark 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 "))

Show Answer
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

1 comment
Sign in to comment
AhloOption: D
Feb 27, 2024

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