def add_category_labels(level_name, cat_name, dataframe_needing_cat):
    '''A function that adds a category name column to a pandas dataframe

        :param level_name: an aggregation from elasticsearch results with nesting
        :type level_name: elasticsearch response.aggregation object
        :param cat_name: an aggregation from elasticsearch results with nesting
        :type cat_name: elasticsearch response.aggregation object
        :param dataframe_needing_cat: a pandas dataframe to append category name too
        :type dataframe_needing_cat: elasticsearch response.aggregation object
        :returns: pandas data frame like example above, with nested data
    '''
    cat_name_dataframe = pd.DataFrame(
        [level_name for i in range(0, dataframe_needing_cat.shape[0])])  # create a cat name column
    cat_name_dataframe.columns = [cat_name]  # name the column something meaningful
    return pd.concat([cat_name_dataframe, dataframe_needing_cat], axis=1)
A function that adds a category name column to a pandas dataframe

        :param level_name: an aggregation from elasticsearch results with nesting
        :type level_name: elasticsearch response.aggregation object
        :param cat_name: an aggregation from elasticsearch results with nesting
        :type cat_name: elasticsearch response.aggregation object
        :param dataframe_needing_cat: a pandas dataframe to append category name too
        :type dataframe_needing_cat: elasticsearch response.aggregation object
        :returns: pandas data frame like example above, with nested data