Exam generated for <EMAILADDRESS> 10
(e) (2 pt)
A bar chart that shows, for each day of the week, the number of applications for that day of week.
Our staff solution has the form ____.____(____).____(____, ____)
TRUCKS.group("Day of Week").barh('Day of Week', 'count')
(f) (3 pt)
Create a table that shows the average AVG_BY of all trucks, broken down by day of the week. (For
instance, the table should show the average AVG_BY of all applicants for Monday, the average AVG_BY
of all applicants for Tuesday, and so on.)
Our staff solution has the form ____.____(____).____(____, ____)
TRUCKS.group('Day of Week', np.mean).select('Day of Week', 'AVG_BY mean')
(g) (3 pt)
Create a table that shows the average AVG_BY of all trucks that close strictly before CLOSE_BEFORE:00,
broken down by day of the week and by whether the truck serves hot dishes or not.
Our staff solution has the form ____.____(____, ____).____(____, ____)
TRUCKS.where("End Time", are.below(CLOSE_BEFORE)).pivot("Hot Dishes", "Day
of Week", values='AVG_BY', collect=np.mean) OR TRUCKS.where("End Time",
are.below(CLOSE_BEFORE)).group(["Hot Dishes", "Day of Week"], np.mean)
(h) (4 pt)
Create a table that shows, for each applicant, how many different days of the week they have
applied for. For instance, Kettle Corn Star has applied for 2 days of the week (Monday and Tuesday).
Your table should have two columns, ‘Applicant’ and ‘Number of Days’.
Our staff solution has the form ____.____(____).____(____).____(____, ____)
TRUCKS.group(["Applicant", "Day of Week"]).group("Applicant").relabeled('count',
'Number of Days')
(i) (2 pt)
Parham, who collected the data, forgot to ask each applicant to include their phone numbers on
their application. He asks each applicant to give him their phone number and stores it in a two column
table called
PHONE_NUMBERS_TBL
. The table has a column called “Applicant Name” that contains the unique
names of the applicants and a column called “Phone Number” that contains the phone numbers of each
applicant. Complete the line of code so that it evaluates to a table that has all the same columns as
the
TRUCKS
table as well as a column called “Phone Number” that contains the phone number for that
applicant.
Our staff solution has the form ____.____(____, ____, ____)
TRUCKS.join("Applicant", PHONE_NUMBERS, "Applicant Name")