Analizzare campagne di marketing con pandas
Jill Rosok
Data Scientist

Analizzare le performance delle campagne
Attribuire le conversioni ai canali
A/B test

Import/export semplici di formati comuni (CSV, TSV, Stata)
Permette join, group by e aggregazioni, e di selezionare colonne e righe.
import pandas as pd
marketing = pd.read_csv('marketing.csv')
print(marketing.head())
user_id date_served channel variant conv \
0 a100000029 2018-01-01 House Ads personalization True
1 a100000030 2018-01-01 House Ads personalization True
2 a100000031 2018-01-01 House Ads personalization True
3 a100000032 2018-01-01 House Ads personalization True
4 a100000033 2018-01-01 House Ads personalization True
language_displayed language_preferred age_group
0 English English 0-18 years
1 English English 19-24 years
2 English English 24-30 years
3 English English 30-36 years
4 English English 36-45 years
print(marketing.describe())
user_id date_served channel variant conv \
count 9882 9881 9882 9882 9882
unique 7253 31 5 2 2
top a100000882 2018-01-15 House Ads control False
freq 6 782 4682 4986 8883
language_displayed language_preferred age_group
count 9882 9882 9882
unique 4 4 7
top English English 19-24 years
freq 9695 9177 1650
print(marketing.info())
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 9996 entries, 0 to 9995
Data columns (total 12 columns):
# Column Non-Null Count Dtype
------ -------------- -----
0 user_id 9996 non-null object
1 date_served 9980 non-null object
...
9 date_subscribed 1815 non-null object
10 date_canceled 568 non-null object
11 subscribing_channel 1815 non-null object
12 is_retained 1815 non-null object
dtypes: object(12)
memory usage: 937.2+ KB
Analizzare campagne di marketing con pandas