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