QuestionQ22

VerifiedData Processing

A data scientist has a Spark DataFrame named spark_df. They need to create a new Spark DataFrame containing only rows from spark_df whose value in the price column is greater than 0.

Which of the following code blocks accomplish this task?

Choose two
Explanation

A Spark DataFrame can be filtered with a Boolean Column expression. Both spark_df[... ] and spark_df.filter(...) accept a condition such as price > 0 and return a new DataFrame containing only rows for which that condition is true.

Learn more

Community Discussion

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