Analyzing user preferences
To understand the true impact of the bug, it is crucial to determine how many subscribers we would have expected had there been no language error. This is crucial to understanding the scale of the problem and how important it is to prevent this kind of error in the future.
In this step, you will create a new DataFrame that you can perform calculations on to determine the expected number of subscribers. This DataFrame will include how many users prefer each language by day. Once you have the DataFrame, you can begin calculating how many subscribers you would have expected to have had the language bug not occurred.
Deze oefening maakt deel uit van de cursus
Analyzing Marketing Campaigns with pandas
Oefeninstructies
- Group
house_adsbydate_servedandlanguage_preferred. - Use a dictionary within a call to
.agg()to calculate the number of unique users and sums the number of converted users. - Unstack
convertedatlevel = 1
Praktische interactieve oefening
Probeer deze oefening eens door deze voorbeeldcode in te vullen.
# Group house_ads by date and language
converted = house_ads.groupby(____)\
.agg({'____':'____',
'____':'____'})
# Unstack converted
converted_df = pd.DataFrame(____.____(____))