Analyzing custom segments
As a final step, you will analyze average values of Recency, Frequency and MonetaryValue for the custom segments you've created.
We have loaded the datamart dataset with the segment values you have calculated in the previous exercise. Feel free to explore it in the console. pandas library is also loaded as pd.
Questo esercizio fa parte del corso
Customer Segmentation in Python
Istruzioni dell'esercizio
- Calculate the averages for
Recency,FrequencyandMonetaryValuefor eachRFM_Levelsegment. - As the last column, return the size of each segment passing
countto theMonetaryValuecolumn next to themean. - Print the aggregated dataset.
Esercizio pratico interattivo
Prova a risolvere questo esercizio completando il codice di esempio.
# Calculate average values for each RFM_Level, and return a size of each segment
rfm_level_agg = datamart.____('____').____({
'____': '____',
'____': '____',
# Return the size of each segment
'____': ['____', '____']
}).round(1)
# Print the aggregated dataset
print(____)