Skip to Content
Mastering Marketing Data Science
book

Mastering Marketing Data Science

by Iain Brown
April 2024
Beginner to intermediate
432 pages
12h 45m
English
Wiley
Content preview from Mastering Marketing Data Science

EXERCISE 3.1: DESCRIPTIVE ANALYSIS OF MARKETING DATA

Objective: Understand and describe the central tendencies, dispersion, and associations in the marketing data.

Tasks:

  1. Calculate Descriptive Statistics: Compute mean, median, and mode for variables such as ‘Ad Spend’, ‘Clicks’, and ‘Sales’.
  2. Visualization: Create bar charts for engagement metrics, line charts for ad spend over time, and scatterplots to show relationships between ad spend and conversions.
  3. Interpretation: Analyze the results, discussing any interesting findings or patterns.

Steps:

  1. Import Libraries:
    1. import pandas as pd
    • We import the Pandas library, which is essential for data manipulation and analysis.
  2. Load the Dataset:
    2. marketing_data = pd.read_csv('path_to_csv_file')
    • Replace ‘path_to_csv_file’ with the actual path of the marketing_data CSV file.
    • This line reads the CSV file into a Pandas DataFrame, which is a two-dimensional labeled data structure.
  3. Calculate Descriptive Statistics:
    3. descriptive_stats = marketing_data.describe()
    • The describe() function in Pandas provides a summary of the central tendency, dispersion, and shape of the dataset’s distribution, excluding NaN values. It calculates statistics such as mean, standard deviation, minimum, and maximum values for each column.

Visualization:

  1. Import Visualization Library:
    4. import matplotlib.pyplot as plt
    • We import Matplotlib, a widely used library for creating static, animated, and interactive visualizations in Python.
  2. Create a Bar ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Data Science for Business

Data Science for Business

Foster Provost, Tom Fawcett
Data Science for Marketing Analytics - Second Edition

Data Science for Marketing Analytics - Second Edition

Mirza Rahim Baig, Gururajan Govindan, Vishwesh Ravi Shrimali

Publisher Resources

ISBN: 9781394258710Purchase Link