The code block shown below should return a copy of DataFrame transactionsDf with an added column cos. This column should have the values in column value converted to degrees and having the cosine of those converted values taken, rounded to two decimals. Choose the answer that correctly fills the blanks in the code block to accomplish this. Code block: transactionsDf.__1__(__2__, round(__3__(__4__(__5__)),2))
Correct Answer: C
The code block displayed below contains one or more errors. The code block should load parquet files at location filePath into a DataFrame, only loading those files that have been modified before 2029-03-20 05:44:46. Spark should enforce a schema according to the schema shown below. Find the error. Schema: 1. root 2. |– itemId: integer (nullable = true) 3. |– attributes: array (nullable = true) 4. | |– element: string (containsNull = true) 5. |– supplier: string (nullable = true) Code block: 1. schema = StructType([ 2. StructType(“itemId”, IntegerType(), True), 3. StructType(“attributes”, ArrayType(StringType(), True), True), 4. StructType(“supplier”, StringType(), True) 5. ]) 6. 7. spark.read.options(“modifiedBefore”, “2029-03-20T05:44:46”).schema(schema).load(filePath)
Correct Answer: D
The code block shown below should return a copy of DataFrame transactionsDf with an added column cos. This column should have the values in column value converted to degrees and having the cosine of those converted values taken, rounded to two decimals. Choose the answer that correctly fills the blanks in the code block to accomplish this. Code block: transactionsDf.__1__(__2__, round(__3__(__4__(__5__)),2))
Correct Answer: C
Which of the following code blocks returns all unique values across all values in columns value and productId in DataFrame transactionsDf in a one-column DataFrame?
Correct Answer: D





Prep2Certsis a premium service offering a comprehensive collection of exam questions and answers for over 1400 certification exams. It is regularly updated and designed to help users pass their certification exams confidently.
Please contact info@Prep2Certs.com and we will provide you with alternative payment options.
You can by Contacting our sales team.