Last active
August 11, 2017 03:34
-
-
Save dsal1951/a04287b0f855f10b5b18a6f01f90d68b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
group_df = df.groupby('GROUP') | |
#Total Number of Leads in each Group | |
leads_count = group_df['CONVERT_ACTUAL'].count() | |
#Number of Leads who Converted in Each Group | |
convert_count = group_df['CONVERT_ACTUAL'].sum() | |
lift = convert_count/leads_count | |
#Consolidate Results into Output Dataframe | |
lift_df = pd.DataFrame({ | |
'CONVERT_COUNT': convert_count, | |
'LEADS_COUNT': leads_count, | |
'LIFT':lift}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment