March 2019
Beginner to intermediate
464 pages
10h 57m
English
Now, let's see whether we can find any noticeable patterns in the sales channel and engagement. We are going to analyze how the engaged and non-engaged customers are distributed among different sales channels. Let's first look at the following code:
engagement_by_sales_channel_df = pd.pivot_table( df, values='Response', index='Sales Channel', columns='Engaged', aggfunc=len).fillna(0.0)engagement_by_sales_channel_df.columns = ['Not Engaged', 'Engaged']
As you can see in this code snippet, we are using the pivot_table function in the pandas library to group by the Sales Channel and Response variables. Once you run this code, engagement_by_sales_channel_df will have the following data:
As you will have noticed in the previous ...
Read now
Unlock full access