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 "))
A.
The describe() operation doesn't compute summary statistics for a single column — the summary() operation should be used instead.
B.
The column sqft should be subsetted from DataFrame storesDF prior to computing summary statistics on it alone.
C.
The describe() operation does not accept a Column object as an argument outside of a list — the list [col("sqft")] should be specified instead.
D.
The describe() operation does not accept a Column object as an argument — the column name string "sqft" should be specified instead.
E.
The describe() operation doesn't compute summary statistics for numeric columns — the sumwary() operation should be used instead.
Answer D correct
https://spark.apache.org/docs/latest/api/python/reference/pyspark.sql/api/pyspark.sql.DataFrame.describe.html
upvoted 1 times
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
Ahlo
9 months ago