How to Unmask Customer Churn through Exploratory Data Analysis (EDA)

Efoniction Anto Himothius Presley Avatar

How statistical profiling, data wrangling, and multi-variable visualization uncovered the hidden triggers of subscriber attrition across 7,000+ accounts.


Preview unavailable Figure 0: Exploratory Data Analysis pipeline transforming raw telecommunications data into actionable customer retention intelligence.


1. Introduction: Why Exploratory Data Analysis Matters

In customer-centric industries like telecommunications, software-as-a-service (SaaS), and subscription media, customer acquisition costs (CAC) continue to climb. Winning a new customer often costs 5 to 7 times more than retaining an existing one. Consequently, predicting and curbing customer churn—the rate at which subscribers discontinue their services—is one of the highest-leverage operational challenges any recurring revenue business faces.

Before building predictive machine learning models or deploying classification pipelines, every data professional must embark on a foundational, investigative stage: Exploratory Data Analysis (EDA).

During my Data Science internship at Valentius Kryptix, I tackled the milestone “Python & Pandas EDA”, conducting a comprehensive analysis on the Telco Customer Churn dataset (comprising 7,043 customer accounts across 21 diverse features). The objectives were clear:

  1. Audit data integrity and resolve structural defects.
  2. Perform univariate, bivariate, and multivariate statistical explorations.
  3. Identify the demographic, contractual, and financial drivers behind subscriber attrition.
  4. Translate raw statistical patterns into concrete, executive-level business recommendations.

Here is the complete journey—from raw CSV ingestion to actionable retention strategies—including the Python code snippets and visual findings discovered along the way.


2. Dataset Architecture & Environment Setup

The dataset tracks customer demographic attributes, contracted telecom and digital services, payment methods, tenure length, and billing charges.

pythonimport osimport pandas as pdimport numpy as npimport matplotlib.pyplot as pltimport seaborn as sns# Set publication-quality stylingsns.set_theme(style="whitegrid", font="sans-serif")plt.rcParams.update({    'font.size': 11,    'axes.labelsize': 12,    'axes.titlesize': 14,    'figure.autolayout': True})# Load the raw datasetdf = pd.read_csv("data/WA_Fn-UseC_-Telco-Customer-Churn.csv")print(f"Dataset Dimensions: {df.shape[0]:,} rows x {df.shape[1]} columns")

Initial Data Diagnostics

A preliminary audit with df.info() yielded valuable structural insights:

  • Rows: 7,043
  • Columns: 21 (mixing boolean flags, categorical services, continuous charges, and ordinal contract variables)
  • Deep Memory Footprint: ~4.39 MB

While 20 columns appeared clean with zero standard NaN values, TotalCharges was surprisingly categorized as an object (string) data type rather than a floating-point numeric column.


3. Data Cleaning: Unearthing the “Silent” Whitespace Bug

One of the most insidious pitfalls in data analysis is “clean-looking” dirty data. Running df.isnull().sum() reported zero missing entries across all 21 columns. However, attempting mathematical aggregation on TotalCharges resulted in a ValueError.

A systematic string inspection revealed that 11 rows contained whitespace characters (' '):

python# Identify records with whitespace in TotalChargeswhitespace_mask = df['TotalCharges'].astype(str).str.strip() == ''print(f"Hidden whitespace entries: {whitespace_mask.sum()}")# Inspect the associated recordsprint(df[whitespace_mask][['customerID', 'tenure', 'MonthlyCharges', 'TotalCharges']])

The Root Cause & The Fix

Every single one of these 11 accounts had a tenure of 0 months. These were brand-new customers who had signed up in the active billing cycle and had not yet received their first monthly invoice.

Instead of dropping these rows (which would introduce survivor bias against newly acquired subscribers), we coerced the column to numeric format and imputed the zero-tenure cumulative charges with 0.0:

python# Coerce to float64, turning unparseable whitespace into NaN, then impute with 0.0df['TotalCharges'] = pd.to_numeric(df['TotalCharges'], errors='coerce').fillna(0.0)

Preview unavailable Figure 1: Missing value distribution across all features following diagnosis. Only TotalCharges exhibited non-standard missing values (0.16%), isolated strictly to tenure = 0.


4. Uncovering the Anatomy of Churn: Univariate & Bivariate EDA

With our dataset validated and cleaned, we examined our primary target variable: Churn.

pythonchurn_counts = df['Churn'].value_counts()churn_rate = df['Churn'].value_counts(normalize=True) * 100print(f"Active Customers:   {churn_counts['No']:,} ({churn_rate['No']:.1f}%)")print(f"Churned Customers:  {churn_counts['Yes']:,} ({churn_rate['Yes']:.1f}%)")

Preview unavailable Figure 2: Overall target distribution. More than 1 in 4 accounts (26.5%) has cancelled service, representing 1,869 lost subscribers.


Finding 1: The Contract Cliff (Month-to-Month Vulnerability)

Segmenting churn by contract type revealed our single most striking insight:

pythoncontract_churn = df.groupby('Contract')['Churn'].apply(    lambda x: (x == 'Yes').mean() * 100).reset_index(name='ChurnRate')print(contract_churn)

Preview unavailable Figure 3: Churn rates across contract structures. Month-to-month contracts experience a staggering 42.7% attrition rate compared to just 2.8% for 2-year contracts.

Customers on flexible month-to-month contracts are over 15 times more likely to churn than customers on two-year agreements. While month-to-month subscribers make up 55% of the total customer base, they account for 88.6% of all churned accounts.


Finding 2: Pricing Sensitivity & The $70–$100 Danger Zone

Next, we evaluated monthly recurring charges against churn status using kernel density estimation (KDE):

pythonplt.figure(figsize=(9, 5))sns.kdeplot(data=df[df['Churn'] == 'No'], x='MonthlyCharges', fill=True, label='Retained', color='#2ca02c')sns.kdeplot(data=df[df['Churn'] == 'Yes'], x='MonthlyCharges', fill=True, label='Churned', color='#d62728')plt.title('Monthly Charges Distribution: Retained vs. Churned')plt.xlabel('Monthly Charges ($)')plt.ylabel('Density')plt.legend()plt.show()

Preview unavailable Figure 4: Distribution of monthly billing amounts. Churned accounts display a pronounced density cluster between $70 and $100 per month.

  • Retained Customers: Median monthly bill is $64.43, with a strong mode in the basic $20–$30 tier.
  • Churned Customers: Median monthly bill jumps to $79.65, with peak drop-offs concentrated in the $70–$100 bracket.

Subscribers do not defect solely due to overall dissatisfaction; they leave when high pricing is not matched by ongoing, tangible value.


Finding 3: The 12-Month Onboarding Cliff

Analyzing tenure (account age in months) revealed the exact temporal lifecycle where accounts are at risk:

Preview unavailable Figure 5: Customer tenure density curves. Over 50% of churn occurs within the first 12 months, with a median churned tenure of just 10 months.

  • 25% of all churned customers leave within their first 60 days.
  • Over 50% of total churn takes place within the first 12 months.
  • Conversely, once an account crosses the 24-month mark, customer loyalty increases substantially, and churn rates decline below 10%.

The first 90 days represent an operational “danger zone” where proactive onboarding directly dictates customer lifetime value (CLV).


Finding 4: Technical Support as a Retention Shield

Does service bundling mitigate churn? We investigated internet service tiers (Fiber Optic vs. DSL) cross-tabulated with the presence of TechSupport:

Preview unavailable Figure 6: Churn rate comparison when Tech Support is attached vs. omitted across Internet tiers.

The findings were striking:

  • Fiber Optic without Tech Support: Churn reaches 49.4% (nearly 1 in 2 subscribers leaves).
  • Fiber Optic with Tech Support: Churn drops to 33.5% (a 15.9 percentage point decrease).
  • DSL without Tech Support: Churn sits at 29.5%.
  • DSL with Tech Support: Churn plummets to just 10.5%.

Technical support acts as an indispensable shock absorber. Fiber optic connections often face installation nuances or Wi-Fi configuration friction; accessible technical assistance directly protects subscription revenue.


Finding 5: Feature Correlation Hierarchy

To map how features correlate with churn across the whole dataset, we encoded binary variables and generated a ranked Pearson correlation matrix:

pythonnumeric_df = df.copy()numeric_df['Churn_Numeric'] = (numeric_df['Churn'] == 'Yes').astype(int)correlations = numeric_df.corr(numeric_only=True)['Churn_Numeric'].sort_values()print(correlations)

Preview unavailable Figure 7: Feature correlations ranked by association with customer churn. Account tenure is the strongest protective factor (r = -0.35), while Monthly Charges and Paperless Billing are positive correlates.


5. Summary of Key Analytical Findings

Finding #CategoryCore Statistical InsightBusiness Impact
1Contract StructureMonth-to-month contracts experience 42.7% churn vs. 2.8% for two-year plans.Month-to-month accounts generate 88.6% of all churn.
2Account AgeMedian tenure of churned users is 10 months; 25% churn in < 2 months.First-year onboarding is the critical retention window.
3Billing AmountChurned customers pay a higher median fee ($79.65 vs. $64.43).High prices without perceived value drive defection.
4Service SupportAdding Tech Support reduces Fiber Optic churn from 49.4% down to 33.5%.Bundled assistance functions as an essential churn barrier.
5Payment MethodElectronic check users churn at 45.3% vs. ~15% for auto-bank transfers.Manual payment introduces recurring cancellation friction.

6. Strategic Business Recommendations

Based on empirical data analysis, telecommunications leadership should implement four strategic initiatives:

  1. Incentivize Annual Commitment Migrations:
    • Offer month-to-month subscribers a targeted 10%–15% rate discount or complimentary hardware upgrades if they transition to a 1-year or 2-year agreement.
  2. Launch a Structured “Day 0–90” Onboarding Program:
    • Deploy automated check-in notifications, proactive service diagnostics, and customer satisfaction surveys at Day 14, Day 45, and Day 80 to prevent the first-year drop-off.
  3. Bundle Technical Assistance into Premium Tiers:
    • Automatically include 6 months of complimentary Tech Support and Online Security with every new Fiber Optic installation.
  4. Drive Automated Billing Adoption:
    • Offer a one-time $10 account credit for users who transition from manual electronic checks to recurring automatic credit card or ACH bank payments.

7. Key Technical Takeaways & Reflections

Completing the “Python & Pandas EDA” milestone at Valentius Kryptix reinforced several core data science principles:

  • Always interrogate data types: Standard inspection tools (.isnull()) will miss silent data corruptions such as whitespace strings and non-standard placeholders.
  • Avoid premature machine learning: A model trained without EDA is a black box built on unverified assumptions. EDA provides the domain intuition required for meaningful feature engineering.
  • Visualize with intent: Effective data visualization is not about decorating a report; it is about surfacing contrasts, distributions, and actionable patterns that empower non-technical stakeholders to make data-driven decisions.

8. Code & Resources

The full Jupyter Notebook, clean reproducible Python scripts, and high-resolution chart assets are publicly available on GitHub:

📂 GitHub Repository: https://github.com/efoniction/Internship-program

Have questions, feedback, or suggestions on feature engineering strategies for churn prediction? Feel free to connect or leave a comment below!

Efoniction Anto Himothius Presley Avatar

Leave a Reply

You May Love