def mse(df, y:str, yhats:list):
    """
    Calculates Mean Squared Error.
    Args:
        df: pandas dataframe
        y: name of column with actual data
        yhats: list of column names with estimated data
    Returns:
        df: containing the MPE for each column
    """

    columns_to_keep = yhats + [y]
    df = df.copy()[columns_to_keep]

    #calculate the absolute difference for each column
    for col in columns_to_keep:
        df[col] = (df[y] - df[col])**2

    #sum the values and take the average
    df = df.mean()

    return df