← return to practice.dsc10.com
This quiz was administered in-person. Students were allowed a cheat
sheet. Students had 20 minutes to work on the
quiz.
This quiz covered Lectures 7-11 of the Winter 2025 offering
of DSC 10.
The DataFrame blue_bowl
contains information about
orders placed by UCSD students at Blue Bowl, an on-campus eatery
specializing in custom bowls. For each order, we have the cusstomer’s
"student_id"
, the "base"
of their bowl, which
"fruit"
they got, and the number of additional toppings,
"num_toppings"
. The first five rows are shown below.
Fill in the blanks so that the statement below outputs a DataFrame
showing the most popular base and fruit combinations in the
blue_bowl
DataFrame, in descending order of popularity.
blue_bowl.groupby(__(a)__).__(b)__.sort_values(__(c)__)
Answer (a): ['base', 'fruit']
The average score on this problem was 90%.
Answer (b): count()
The average score on this problem was 90%.
Answer (c):
"student_id", ascending = False
The average score on this problem was 84%.
Let five_bowls
be the smaller DataFrame consisting of
only the first five rows of blue_bowl
.
How many rows are in the DataFrame
five_bowls.merge(five_bowls, on="base")
?
5
9
11
15
25
None of these
Answer: 9
The average score on this problem was 63%.
How many rows are in the DataFrame
five_bowls.merge(five_bowls, on="fruit")
?
5
9
11
15
None of these
Answer: 11
The average score on this problem was 61%.
Suppose there are five available fruits: strawberries (red), bananas (yellow), raspberries (red), pomegranate (red), and pineapple (yellow). If Pranav orders a bowl with one fruit and tells you that the fruit is red, what is the probability he did not get strawberries?
Answer: 2/3
The average score on this problem was 84%.
The density histogram below shows the distribution of
"num_toppings"
for 250 unique orders in
blue_bowl
.
Kate orders a bowl with exactly two toppings. Which bin is her order included in?
A
B
C
D
E
F
G
Answer: C
The average score on this problem was 89%.
How many more orders were there with one topping than orders with no toppings? Give your answer as an integer rounded to the nearest multiple of 5.
Answer: 25
The average score on this problem was 81%.
Fill in the body of the function prep_time
such that
both expressions below evaluate to the same Series.
"num_toppings").apply(prep_time)
blue_bowl.get(
1.2 + 0.2 * blue_bowl.get("num_toppings")
def prep_time(x):
return
Answer: 1.2 + .2 * x
The average score on this problem was 80%.