Skip to content
An analysis of customer segments for target marketing
  • AI Chat
  • Code
  • Report
  • Where to focus a marketing campaign?

    📖 Background

    You are a data analyst at a crowdfunding site. For the next quarter, your company will be running a marketing campaign. The marketing manager wants to target those segments that have donated the most in the past year. She turned to you to help her with her upcoming meeting with the CEO.

    💾 The data

    You have access to the following information:

    Historic crowdfunding donations
    • "category" - "Sports", "Fashion", "Technology", etc.
    • "device" - the type of device used.
    • "gender" - gender of the user.
    • "age range" - one of five age brackets.
    • "amount" - how much the user donated in Euros.
    import pandas as pd
    import as px
    df = pd.read_csv('./data/crowdfunding.csv')

    💪 Challenge

    Create a single visualization that the marketing manager can use to explore the data. Include:

    1. What are the top three categories in terms of total donations?
    2. What device type has historically provided the most contributions?
    3. What age bracket should the campaign target?


    category_list = df.groupby('category').amount.sum().sort_values(ascending=False).reset_index()
    top3_catigories = category_list.iloc[:3]
    device_age = df.groupby(['device', 'age'])['amount'].sum().reset_index()
    fig =, x='category', y='amount', color='amount', title = 'Top 3 Category Donations')
    fig =, x='age', y='amount', color ='device', title = 'Contributions per Device per Age Group')