March 2019
Beginner to intermediate
464 pages
10h 57m
English
It might be true that certain job categories tend to convert more frequently than others. Let's take a look at the conversion rates across different job categories. You can achieve this by using the following code:
conversion_rate_by_job = df.groupby( by='job')['conversion'].sum() / df.groupby( by='job')['conversion'].count() * 100.0
Let's take a deeper look at this code. We first group by the column, job, which contains information about the job category that each customer belongs to. Then, we sum over the conversion column for each job category, from which we get the total number of conversions for each job category. Lastly, we divide these conversion numbers by the total number of customers in each job category, ...
Read now
Unlock full access