Databricks Certified Machine Learning Associate Exam Databricks-Machine-Learning-Associate Question # 2 Topic 1 Discussion

Databricks Certified Machine Learning Associate Exam Databricks-Machine-Learning-Associate Question # 2 Topic 1 Discussion

Databricks-Machine-Learning-Associate Exam Topic 1 Question 2 Discussion:
Question #: 2
Topic #: 1

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?


A.

spark_df.loc[:,spark_df["discount"] <= 0]


B.

spark_df[spark_df["discount"] <= 0]


C.

spark_df.filter (col("discount") <= 0)


D.

spark_df.loc(spark_df["discount"] <= 0, :]


Get Premium Databricks-Machine-Learning-Associate Questions

Contribute your Thoughts:


Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.