QuestionQ120

VerifiedDeveloping Apache Spark™ DataFrame/DataSet API Applications

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

storesDF.describes(col("sgft "))  
Explanation

PySpark DataFrame.describe computes basic statistics for one or more numeric or string columns, and its column arguments must be column-name strings (or a list of column-name strings). A Column expression created with col() is not a valid argument; the intended column should be supplied as the string "sqft".

Learn more

Community Discussion

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