March 2019
Beginner to intermediate
464 pages
10h 57m
English
In this section, we will take a look at whether customers with various vehicle sizes respond differently to different sales channels. Take a look at the following code to compute the engagement rates per sales channel and vehicle size:
by_sales_channel_df = df.loc[ df['Response'] == 'Yes'].groupby([ 'Sales Channel', 'Vehicle Size']).count()['Customer']/df.groupby('Sales Channel').count()['Customer']
The result looks as in the following:

As before, we can unstack this data into a more visible format, using the following code:
by_sales_channel_df = by_sales_channel_df.unstack().fillna(0)
The ...
Read now
Unlock full access