Câu 29: Databricks Certified Associate Developer for Apache Spark
The code block shown below contains an error. The code block is intended to return a new DataFrame with the mean of column sqft from DataFrame storesDF in column sqftMean. Identify the error. Code block:storesDF.agg(mean("sqft").alias("sqftMean"))
Nội dung câu hỏi
The code block shown below contains an error. The code block is intended to return a new DataFrame with the mean of column sqft from DataFrame storesDF in column sqftMean. Identify the error. Code block:storesDF.agg(mean("sqft").alias("sqftMean"))
Các lựa chọn
Đáp án được giữ gọn theo nhãn A, B, C, D trong phần bình chọn tương tác.
- A. The argument to the mean() operation should be a Column abject rather than a string column name. — đáp án hiện tại
- B. The argument to the mean() operation should not be quoted.
- C. The mean() operation is not a standalone function – it’s a method of the Column object.
- D. The agg() operation is not appropriate here – the withColumn() operation should be used instead.
- E. The only way to compute a mean of a column is with the mean() method from a DataFrame.
Cộng đồng
0 bình luận công khai. Tên thành viên được ẩn một phần.
Chưa có bình luận. Mở giao diện tương tác để bắt đầu thảo luận.