Ejemplo n.º 1
0
def update_ga_category(selected_rows, end_date):
    travel_product = []
    travel_product_list = sorted(df['GA Category'].unique().tolist())
    for i in selected_rows:
        travel_product.append(travel_product_list[i])
        # Filter by specific product
    filtered_df = df[(df['GA Category'].isin(travel_product))].groupby(
        ['Year', 'Week']).sum()[[
            'Spend TY', 'Spend LY', 'Sessions - TY', 'Sessions - LY',
            'Bookings - TY', 'Bookings - LY', 'Revenue - TY', 'Revenue - LY'
        ]].reset_index()
    fig = update_graph(filtered_df, end_date)
    return fig
Ejemplo n.º 2
0
def update_metasearch(selected_rows, end_date):
    travel_product = []
    travel_product_list = df[(df['Category'] == 'Metasearch and Travel Ads'
                              )]['Placement type'].unique().tolist()
    for i in selected_rows:
        travel_product.append(travel_product_list[i])
        # Filter by specific product
    filtered_df = df[(df['Placement type'].isin(travel_product))].groupby(
        ['Year', 'Week']).sum()[[
            'Spend TY', 'Spend LY', 'Sessions - TY', 'Sessions - LY',
            'Bookings - TY', 'Bookings - LY', 'Revenue - TY', 'Revenue - LY'
        ]].reset_index()
    fig = update_graph(filtered_df, end_date)
    return fig
Ejemplo n.º 3
0
def update_line_graph(proj, conf, start_date, end_date):
    line_data = update_graph(proj, conf, start_date, end_date)
    return line_data
Ejemplo n.º 4
0
def update_hamilton_category(start_date, end_date, serial_number):
    filtered_df = update_first_datatable(start_date, end_date, serial_number)
    fig = update_graph(filtered_df)
    return fig