marking2/danube_test5.scala
changeset 284 9a04eb6a2291
parent 259 43995ea34fe7
equal deleted inserted replaced
283:ef5f62bf5987 284:9a04eb6a2291
     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)