Câu 6: Databricks Certified Machine Learning Associate
A data scientist has a Spark DataFrame spark_df. They want to create a new Spark DataFrame that contains only the rows from spark_df where the value in column discount is less than or equal 0. Which of the following code blocks will accomplish this task?
Nội dung câu hỏi
A data scientist has a Spark DataFrame spark_df. They want to create a new Spark DataFrame that contains only the rows from spark_df where the value in column discount is less than or equal 0. Which of the following code blocks will accomplish this task?
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. spark_df.loc[:,spark_df["discount"] <= 0]
- B. spark_df[spark_df["discount"] <= 0]
- C. spark_df.filter (col("discount") <= 0) — đáp án hiện tại
- D. spark_df.loc(spark_df["discount"] <= 0, :]
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.