book

Report

As a class, we brainstormed and came up with a long list of further questions we can ask based on the "self-introduction" data. Out of these questions, our team chose to tackle on the following:

How many students are Computer Science major?

var list=_.filter(_.pluck(data.comments, 'body'), function(text){
	return _.includes(text, "Computer Science") || _.includes(text, "CS")
})
return _.size(list)
The answer is 20.

How many students' names start with 'A'?

var list=_.filter(_.pluck(data.comments, 'body'), function(text){
	var a=text.split("\r\n")[0]
	var name=_.last(text.split("Name:"))
	return name.charAt(1) == 'A'
})
return _.size(list)
The answer is 4.

How many students are not Computer Science major?

var list=_.filter(_.pluck(data.comments, 'body'), function(text){
	return _.includes(text, "Computer Science") || _.includes(text, "CS")
})
return data.comments.length-_.size(list)
The answer is 6.

What's the github id of zhya215?

var list=_.filter(data.comments, function(text){
	return _.includes(text.user, "zhya215")
})
return _.pluck(list, 'user.id')
The answer is 5596113.