equal
deleted
inserted
replaced
1 |
1 |
2 // first test |
2 // first test |
3 |
3 |
|
4 import CW7b._ |
4 |
5 |
5 def urban_groupById(ratings: List[(String, String)]) = |
6 def urban_groupById(ratings: List[(String, String)]) = |
6 ratings.groupBy(_._1).mapValues(_.map(_._2)) |
7 ratings.groupBy(_._1).view.mapValues(_.map(_._2)).toMap |
7 |
8 |
8 def urban_get_csv_file(name: String) : List[String] = { |
9 def urban_get_csv_file(name: String) : List[String] = { |
9 import io.Source |
10 import io.Source |
10 import scala.util._ |
11 import scala.util._ |
11 val csv = Source.fromFile(name) |
12 val csv = Source.fromFile(name) |