def cov(df, groupby_columns:list, value_column:str):
    """
    Calculates the coefficient of variation for data grouped by specific columns
    Args:
        df: pandas dataframe
        groupby_columns: list of column names to group the data by
        value_column: string name of column containing the values for which you want cov calculated
    Returns:
        result: a pandas df with grouped statistics for count, mean, population standard deviation, and cov
    """

    # define a function to calculate the population standard deviation with ddof=0
    std_p = lambda x: x.std(ddof=0)
    std_p.__name__ = 'std_p'

    columns_to_keep = groupby_columns + [value_column]

    df = df.copy()[columns_to_keep]

    result = df.groupby(groupby_columns).agg(['count','mean',std_p])

    result = result.droplevel(level=0, axis=1)

    result['cov'] = result['std_p'] / result['mean']

    return result