main_solution2/danube.scala
changeset 384 6e1237691307
parent 349 682611a0fb89
child 400 e48ea8300b2d
equal deleted inserted replaced
383:c02929f2647c 384:6e1237691307
    40 //     of (movieId, title) pairs.
    40 //     of (movieId, title) pairs.
    41 
    41 
    42 
    42 
    43 def process_ratings(lines: List[String]) : List[(String, String)] = {
    43 def process_ratings(lines: List[String]) : List[(String, String)] = {
    44   for (cols <- lines.map(_.split(",").toList); 
    44   for (cols <- lines.map(_.split(",").toList); 
    45        if (cols(2).toFloat >= 4)) yield (cols(0), cols(1))  
    45        if (cols(2).toInt >= 4)) yield (cols(0), cols(1))  
    46 }
    46 }
    47 
    47 
    48 def process_movies(lines: List[String]) : List[(String, String)] = {
    48 def process_movies(lines: List[String]) : List[(String, String)] = {
    49   for (cols <- lines.map(_.split(",").toList)) yield (cols(0), cols(1))  
    49   for (cols <- lines.map(_.split(",").toList)) yield (cols(0), cols(1))  
    50 }
    50 }