Databricks Certified Associate Developer for Apache Spark — Question 157

The code block shown below should return a DataFrame containing only the rows from DataFrame storesDF where the value in column sqft is less than or equal to 25,000 AND the value in column customerSatisfaction is greater than or equal to 30. Choose the response that correctly fills in the numbered blanks within the code block to complete this task.

Code block:

storesDF.__1__(__2__ __3__ __4__)

Answer options

Correct answer: A

Explanation

Option A is correct because it uses the filter method along with the appropriate logical operator '&' to combine conditions on the sqft and customerSatisfaction columns. The other options contain syntax errors or incorrect logical operators that would prevent the code from executing correctly, such as missing parentheses or using 'and' instead of '&'.