def value_counts_df(df, col_name):
    """Helper function to use pd.value_counts() for dataframes

    Args:
        df (DataFrame): Dataframe containing column to use value_counts on
        col_names (str): Name of column to count values for. Must be present in df. 

    Returns:
        DataFrame: Data frame with column names `col_name` and `n`.
    """
    if col_name not in df.columns:
        raise ValueError(
            f'Supplied col_name {col_name} is not present in dataframe.')

    count_df = df[col_name].value_counts().to_frame().reset_index()
    count_df.columns = [col_name, 'n']

    return count_df