[Solved]-Question 1 Following Pyspark Statement Replaces Original Salary Column Salary Raise 008 8 Q37270570
Question 1
The following pyspark statement replaces the original Salarycolumn with the salary raise of 0.08 (or 8%).
df = df.withColumn(“Raise”, df.Salary * 0.08)
1) True2) False
Question 2
One key reason that Spark is faster than MapReduce is that Sparkprocesses data in-memory, while MapReduce needs to save the databack to the disk after a map or reduce action.
1) True2) False
Question3
The following result from OneHotEncoding shows that columns 1and 4 contain 1.0 and 2.0 respectively.
[5, [1, 4], [1.0, 2.0] ]
1) True2) False
Question 4
Both Dataset and DataFrame allow you to organize data into namedcolumns.
1) True2) False
Question5
The following statement removes the null value from the Eventcolumn, but the row containing the null value still remains.
players_df.filter(players_df.Event.isNotNull()).show()
1) True2) False
Expert Answer
Answer to Question 1 The following pyspark statement replaces the original Salary column with the salary raise of 0.08 (or 8%). df… . . .
OR

