Next Question >>

Question 1/63

In which order should the code blocks shown below be run in order to create a DataFrame that shows the mean of column predError of DataFrame transactionsDf per column storeId and productId, where productId should be either 2 or 3 and the returned DataFrame should be sorted in ascending order by column storeId, leaving out any nulls in that column?
DataFrame transactionsDf:
1.+-------------+---------+-----+-------+---------+----+
2.|transactionId|predError|value|storeId|productId| f|
3.+-------------+---------+-----+-------+---------+----+
4.| 1| 3| 4| 25| 1|null|
5.| 2| 6| 7| 2| 2|null|
6.| 3| 3| null| 25| 3|null|
7.| 4| null| null| 3| 2|null|
8.| 5| null| null| null| 2|null|
9.| 6| 3| 2| 25| 2|null|
10.+-------------+---------+-----+-------+---------+----+
1. .mean("predError")
2. .groupBy("storeId")
3. .orderBy("storeId")
4. transactionsDf.filter(transactionsDf.storeId.isNotNull())
5. .pivot("productId", [2, 3])

LEAVE A REPLY

Your email address will not be published. Required fields are marked *

Question List (63q)
Question 1: In which order should the code blocks shown below be run in ...
Question 2: The code block shown below should add column transactionDate...
Question 3: Which of the following code blocks performs an inner join be...
Question 4: Which of the following code blocks returns all unique values...
Question 5: Which of the following DataFrame operators is never classifi...
Question 6: Which of the following statements about Spark's DataFrames i...
Question 7: Which of the following describes tasks?...
Question 8: Which of the following code blocks shows the structure of a ...
Question 9: Which of the following code blocks returns a DataFrame that ...
Question 10: The code block shown below should return a copy of DataFrame...
Question 11: The code block displayed below contains an error. The code b...
Question 12: The code block displayed below contains an error. The code b...
Question 13: Which of the following code blocks reads the parquet file st...
Question 14: Which of the following code blocks displays the 10 rows with...
Question 15: The code block shown below should return a DataFrame with on...
Question 16: Which of the following code blocks returns a DataFrame that ...
Question 17: Which of the following code blocks performs an inner join of...
Question 18: Which of the following code blocks returns a new DataFrame w...
Question 19: Which of the following is a viable way to improve Spark's pe...
Question 20: The code block displayed below contains an error. The code b...
Question 21: In which order should the code blocks shown below be run in ...
Question 22: Which of the elements that are labeled with a circle and a n...
Question 23: Which of the following code blocks reads in the JSON file st...
Question 24: Which of the following code blocks concatenates rows of Data...
Question 25: Which of the following describes a difference between Spark'...
Question 26: Which of the following describes Spark's standalone deployme...
Question 27: In which order should the code blocks shown below be run in ...
Question 28: The code block shown below should return a one-column DataFr...
Question 29: The code block shown below should return the number of colum...
Question 30: Which of the following DataFrame methods is classified as a ...
Question 31: The code block displayed below contains an error. The code b...
Question 32: Which of the following describes the role of the cluster man...
Question 33: The code block shown below should show information about the...
Question 34: Which of the following code blocks returns about 150 randoml...
Question 35: Which of the following code blocks returns a single-column D...
Question 36: Which of the following options describes the responsibility ...
Question 37: Which of the following code blocks applies the Python functi...
Question 38: The code block shown below should store DataFrame transactio...
Question 39: Which of the following statements about Spark's execution hi...
Question 40: Which of the following code blocks creates a new DataFrame w...
Question 41: Which of the following statements about executors is correct...
Question 42: Which of the following code blocks returns a 2-column DataFr...
Question 43: Which of the following describes a shuffle?...
Question 44: Which of the following statements about RDDs is incorrect?...
Question 45: The code block shown below should return a copy of DataFrame...
Question 46: Which of the following statements about DAGs is correct?...
Question 47: Which of the following describes a narrow transformation?...
Question 48: Which of the following code blocks returns all unique values...
Question 49: The code block displayed below contains an error. The code b...
Question 50: Which of the following describes a valid concern about parti...
Question 51: Which of the following code blocks applies the boolean-retur...
Question 52: The code block displayed below contains an error. The code b...
Question 53: Which of the following statements about the differences betw...
Question 54: Which of the following code blocks returns a copy of DataFra...
Question 55: Which of the following statements about reducing out-of-memo...
Question 56: Which of the following code blocks silently writes DataFrame...
Question 57: The code block displayed below contains multiple errors. The...
Question 58: The code block displayed below contains an error. When the c...
Question 59: Which of the following code blocks returns a DataFrame where...
Question 60: Which of the following code blocks reorders the values insid...
Question 61: The code block shown below should write DataFrame transactio...
Question 62: The code block shown below should set the number of partitio...
Question 63: The code block shown below should return a single-column Dat...