book

Warmup

Next, complete the following warmup exercises as a team.

How many unique subject codes?

// TODO: replace with code that computes the actual result
return 113

They are 113 unique subject codes.

How many computer science (CSCI) courses?

// TODO: replace with code that computes the actual result
return 63

They are 63 computer science courses.

What is the distribution of the courses across subject codes?

// TODO: replace with code that computes the actual result
return {"HIST": 78,"HONR": 20,"HUMN": 17,"IAFS": 20,"IPHY": 134}

HIST 78
HONR 20
HUMN 17
IAFS 20
IPHY 134

What subset of these subject codes have more than 100 courses?

// TODO: replace with code that computes the actual result
var grps = _.groupBy(data, 'Subject')
var ret = _.pick(_.mapValues(grps, function(d){
    return d.length
}), function(x){
    return x > 100
})
return {"IPHY": 134,"MATH": 232,"MCDB": 117,"PHIL": 160,"PSCI": 117}

IPHY 134
MATH 232
MCDB 117
PHIL 160
PSCI 117

What subset of these subject codes have more than 5000 total enrollments?

// TODO: replace with code that computes the actual result
return {"IPHY": 5507,"MATH": 8725,"PHIL": 5672,"PHYS": 8099,"PSCI": 5491}

IPHY 5507
MATH 8725
PHIL 5672
PHYS 8099
PSCI 5491

What are the course numbers of the courses Tom (PEI HSIU) Yeh taught?

// TODO: replace with code that computes the actual result
return ['4830','4830']

They are 4830,4830.