Which of the following code blocks returns 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?
Which of the following code blocks returns 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?
The correct code block to filter the DataFrame 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 is 'storesDF.filter(col("sqft") <= 25000 & col("customerSatisfaction") >= 30)'. In PySpark, '&' is used for logical AND operations, not 'and'.
A is right
It's D: https://sparkbyexamples.com/spark/spark-and-or-not-operators/ PySpark Logical operations use the bitwise operators: & for and | for or ~ for not
The answer should be E. In case of multiple conditions spark requires () such as: df.filter( (cond1) & (cond2) )
A is the right answer.
No, you do not use and but & in Pyspark D is correct