This project analyzes a subscription business's customer data to understand why customers churn (cancel), and which subscription plans are most at risk.
C6.2 Business Problem
A subscription company is losing customers and wants to understand which factors — tenure, plan type — are linked to churn, so they can take targeted retention action.
C6.3 Dataset Description
Column
Description
customer_id
Unique customer identifier
tenure_months
Number of months as a customer
plan
Subscription plan (Basic, Standard, Premium)
monthly_charge
Monthly subscription fee
churned
Whether the customer cancelled (Yes/No)
Sample scope: 400 customer records from the last 12 months.
C6.4 Objectives
Calculate the overall customer churn rate
Compare tenure between churned and retained customers
Identify which subscription plan has the highest churn rate
Recommend retention strategies based on findings
C6.5 Step-by-Step Solution
Step 1: Load the customer churn CSV into Pandas
Step 2: Clean missing values and check data types
Step 3: Calculate the overall churn rate
Step 4: Compare tenure distributions for churned vs retained customers using a box plot
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
df = pd.read_csv("customer_churn.csv")
df = df.dropna(subset=['churned'])
churn_rate = (df['churned']=='Yes').mean() * 100
print(f"Overall Churn Rate: {churn_rate:.1f}%")
churn_by_plan = df.groupby('plan').apply(lambda x: (x['churned']=='Yes').mean()*100)
print("Churn Rate by Plan:\n", churn_by_plan.round(1))
sns.boxplot(data=df, x="churned", y="tenure_months")
plt.title("Tenure: Churned vs Retained")
plt.savefig("tenure_box.png")
C6.7 Expected Output
Output
Overall Churn Rate: 27.0% Churn Rate by Plan: Basic 35.0 Standard 22.0 Premium 15.0
C6.8 Visualizations
Figure C6.1 — Tenure comparison between churned and retained customers.Figure C6.2 — Churn rate (%) by subscription plan.
C6.9 Key Insights
Overall churn rate stands at 27% — a meaningfully high figure worth immediate attention.
Churned customers have a much shorter median tenure than retained ones — most churn happens early in the customer lifecycle, not after long-term use.
The Basic plan shows the highest churn rate (35%) compared to Premium (15%) — cheaper plans are attracting less committed, higher-risk customers.
C6.10 Business Recommendations
Launch a structured onboarding/engagement program targeting the first 3 months, since this is clearly the highest-risk churn window.
Introduce loyalty incentives specifically for Basic plan subscribers to bridge them toward longer-term retention before the typical churn point.
Consider a mid-tier upgrade nudge campaign — moving Basic users to Standard could meaningfully cut overall churn given the plan-level pattern observed.
✓ Instructor Tip
This dataset structure is ideal groundwork for later machine learning modules (churn prediction models) if the institute plans to introduce ML content in future.