EXERCISE 3.1: DESCRIPTIVE ANALYSIS OF MARKETING DATA
Objective: Understand and describe the central tendencies, dispersion, and associations in the marketing data.
Tasks:
- Calculate Descriptive Statistics: Compute mean, median, and mode for variables such as ‘Ad Spend’, ‘Clicks’, and ‘Sales’.
- Visualization: Create bar charts for engagement metrics, line charts for ad spend over time, and scatterplots to show relationships between ad spend and conversions.
- Interpretation: Analyze the results, discussing any interesting findings or patterns.
Steps:
- Import Libraries:
1. import pandas as pd
- We import the Pandas library, which is essential for data manipulation and analysis.
- 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.
- 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:
- 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.
- Create a Bar ...
Get Mastering Marketing Data Science now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.