author | Christian Urban <christian.urban@kcl.ac.uk> |
Tue, 24 Nov 2020 09:04:06 +0000 | |
changeset 366 | 1c829680503e |
parent 347 | 4de31fdc0d67 |
child 379 | 5616b45d656f |
permissions | -rw-r--r-- |
import io.Source import scala.util._ import CW7b._ def urban_get_csv_file(name: String) : List[String] = { val csv = Source.fromFile(name) csv.mkString.split("\n").toList.drop(1) } val urban_ratings = urban_get_csv_file("ratings.csv") val urban_movies = urban_get_csv_file("movies.csv") assert(process_ratings(urban_ratings).length == 48580) assert(process_movies(urban_movies).length == 9742)