LoslegenKostenlos loslegen

Churn by State

When dealing with customer data, geographic regions may play an important part in determining whether a customer will cancel their service or not. You may have noticed that there is a 'State' column in the dataset. In this exercise, you'll group 'State' and 'Churn' to count the number of churners and non-churners by state. For example, if you wanted to group by x and aggregate by y, you could use .groupby() as follows:

df.groupby('x')['y'].value_counts()

Diese Übung ist Teil des Kurses

Marketing Analytics: Predicting Customer Churn in Python

Kurs anzeigen

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

# Count the number of churners and non-churners by State
print(telco.____('____')['____'].____())
Code bearbeiten und ausführen