IniziaInizia gratis

Merging on different sets of fields

As you saw in the previous exercise, both customer_data and app_purchases have a common 'uid' column that you can use to combine them. If you explored them further, you would discover that they also have a common date column that is named 'date' in app_purchases and 'reg_date' in customer_data.

In this exercise you will explore merging on both of these columns and looking at how this impacts your final results.

The two datasets from the previous exercise - customer_data and app_purchases- have been loaded for you, with 'reg_date' in customer_data renamed to 'date'.

Questo esercizio fa parte del corso

Customer Analytics and A/B Testing in Python

Visualizza il corso

Esercizio pratico interattivo

Prova a risolvere questo esercizio completando il codice di esempio.

# Merge on the 'uid' field
uid_combined_data = app_purchases.merge(____, on=['____'], how='inner')

# Examine the results 
print(uid_combined_data.head())
print(len(uid_combined_data))
Modifica ed esegui il codice