nerdexam
Databricks

DATABRICKS-CERTIFIED-ASSOCIATE-DEVELOPER-FOR-APACHE-SPARK · Question #110

The code block shown below should return a collection of summary statistics for column sqft in DataFrame storesDF. Choose the response that correctly fills in the numbered blanks within the code…

The correct answer is D. 1. describe. DataFrame.describe(*cols) returns a summary DataFrame with statistics including count, mean, standard deviation, min, and max for the specified numeric or string columns. Calling storesDF.describe('sqft') returns these five summary statistics for the sqft column. While…

Spark DataFrame API Operations

Question

The code block shown below should return a collection of summary statistics for column sqft in DataFrame storesDF. Choose the response that correctly fills in the numbered blanks within the code block to complete this task. Code block:

storesDF.1(2)

Options

  • A
    1. summary
  • B
    1. describe
  • C
    1. summary
  • D
    1. describe
  • E
    1. summary

How the community answered

(50 responses)
  • A
    4% (2)
  • C
    6% (3)
  • D
    88% (44)
  • E
    2% (1)

Explanation

DataFrame.describe(*cols) returns a summary DataFrame with statistics including count, mean, standard deviation, min, and max for the specified numeric or string columns. Calling storesDF.describe('sqft') returns these five summary statistics for the sqft column. While summary() also exists and returns additional statistics (including quartiles like 25%, 50%, 75%), the answer key identifies describe as the correct fill-in for blank 1 and 'sqft' for blank 2. The full expression is: storesDF.describe('sqft').

Topics

#PySpark DataFrame#Descriptive Statistics#Spark API#describe method

Community Discussion

No community discussion yet for this question.

Full DATABRICKS-CERTIFIED-ASSOCIATE-DEVELOPER-FOR-APACHE-SPARK Practice