import collections


def read_csv(path):
    """Read data from a CSV file.

    Parameters
    ----------
    path : str
        Path to the CSV file produced by the `ChessAnalysis` program.

    Returns
    -------
    data : dict
        Dictionary mapping player names to a sequence of rating values.
    """
    data = collections.defaultdict(list)
    with open(path) as f:
        next(f)  # First line is header.
        for line in f:
            name, year, mu, sigma = line.strip().split(",")
            data[name].append((int(year), float(mu), float(sigma)))
    return data