import csv


def read_ascents(dirname):
    """Read the ascents table."""
    filename = "%s/ascents.csv" % dirname
    routes = []
    cleans = []
    pages = []
    with open(filename, newline="") as fp:
        reader = iter(csv.reader(fp))

        assert next(reader) == ["route", "clean", "page"]
        for line in reader:
            route, clean, page = line
            routes.append(int(route))
            cleans.append(float(clean))
            pages.append(int(page))

    return (routes, cleans, pages)