Customer service calls and churn
You've already seen that there's not much of a difference in account lengths between churners and non-churners, but that there is a difference in the number of customer service calls left by churners.
Let's now visualize this difference using a box plot and incorporate other features of interest - do customers who have international plans make more customer service calls? Or do they tend to churn more? How about voicemail plans? Let's find out!
Recall the syntax for creating a box plot using seaborn
:
sns.boxplot(x = "X-axis variable",
y = "Y-axis variable",
data = DataFrame)
If you want to remove outliers, you can specify the additional parameter sym=""
, and you can add a third variable using hue
.
This exercise is part of the course
Marketing Analytics: Predicting Customer Churn in Python
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Import matplotlib and seaborn
import matplotlib.pyplot as plt
import seaborn as sns
# Create the box plot
____.____(x = '____',
y = '____',
data = ____)
# Display the plot
plt.show()