SRM INSTITUTE OF SCIENCE & TECHNOLOGY
VADAPALANI CAMPUS
Faculty of Engineering and Technology
Department of Electronics and Communication Engineering
21CSS303T - DATA SCIENCE
COURSE REPORT
NAME: ANAND YASASWINI
REG. NUMBER : RA2311004040024
YEAR / SEM: III/VI
BONAFIDE CERTIFICATE
Register No: RA2311004040024 Date:
Certified to be the bonafide record of work done by ANAND YASASWINI
of III year [Link] in Electronics and Communication Engineering with
specialization in Data Science branch in SRM Institute of Science and
Technology, Vadapalani Campus for the course 21CSS303T - DATA
SCIENCE during the academic year 2025-2026.
Date: Teacher-in-charge Head of the Department
3
CONTENT
[Link]. Title Page No.
1 Project 4
2 Certification Course 13
4
PROJECT
CONTENT
[Link]. Title of the Experiment Page No.
1 Abstract 5
2 Background 6
3 Methodology 7
3 Implementation 9
4 Results and output 10
5 Conclusion 12
6 Reference 12
5
ABSTRACT
This project presents a comprehensive approach to customer segmentation in the telecommunications
industry using data science techniques. The primary objective is to analyze a telecom customer dataset
and partition the customer base into meaningful groups based on behavioral and demographic attributes,
including contract type, monthly charges, tenure, and churn status. By leveraging Python's Pandas library
for data manipulation and Matplotlib for visualization, the study identifies distinct customer segments
that exhibit shared characteristics. The outcomes of this segmentation provide actionable insights for
telecom service providers to improve customer retention strategies, optimize marketing campaigns, and
deliver personalized service offerings. The analysis demonstrates that structured segmentation enables
businesses to make informed, data-driven decisions that directly impact customer satisfaction and long-
term revenue.
6
BACKGROUND
Importance of Customer Segmentation in Telecom
The telecommunications industry operates in a highly competitive environment characterized by low
switching costs and a rapidly evolving service landscape. As a result, customer retention has emerged as
a critical priority for service providers. Customer segmentation is the process of dividing a heterogeneous
customer base into homogeneous subgroups based on shared attributes such as usage behavior,
demographics, billing patterns, and service preferences. This technique allows organizations to move
away from a one-size-fits-all service model and toward a more targeted, customer-centric approach.
In the context of telecom analytics, segmentation plays a pivotal role in understanding why customers
churn, which segments yield the highest revenue, and how service packages can be tailored to meet
specific needs. Without segmentation, service providers risk ineffective marketing spend, poor customer
experience, and elevated churn rates.
Real-World Applications
Customer segmentation in telecom has a wide range of practical applications, including:
• Churn Reduction: Identifying high-risk customer segments enables proactive intervention, such as
personalized discount offers or service upgrades, before a customer decides to switch providers.
• Targeted Marketing: Segments defined by spending levels or contract preferences allow marketing
teams to design campaigns that resonate with specific audiences, thereby improving conversion
rates and return on investment.
• Personalized Service Delivery: Understanding the needs and behaviors of distinct customer groups
allows telecom companies to offer customized service plans, add-ons, and loyalty programs.
• Revenue Management: High-value customer segments can be identified and prioritized for
premium service offerings, while low-engagement segments can be re-engaged through targeted
promotions.
7
METHODOLOGY
Data Preprocessing
The dataset used in this study is a standard telecom customer dataset containing records for over 7,000
customers. Key features include customerID, gender, SeniorCitizen status, tenure (number of months
with the provider), contract type (Month-to-Month, One Year, Two Year), monthly charges, total
charges, and churn status (Yes/No). The first step in the methodology involved thorough data
preprocessing to ensure analytical accuracy.
A critical observation during preprocessing was that the TotalCharges column, which should be a
numeric field, was stored as a string due to the presence of whitespace values. These were first stripped
and then converted to floating-point numbers using appropriate type conversion functions. Records with
invalid or missing values post-conversion were removed from the dataset to maintain data integrity. The
churn column, a binary categorical variable, was retained in its original form for grouping purposes.
Use of Pandas for Grouping and Segmentation
The Pandas library served as the backbone of the data manipulation pipeline. Customer records were
grouped using the groupby function, which enabled the aggregation of key metrics—such as average
monthly charges, average tenure, and churn count—across different categorical dimensions including
contract type and churn status. This approach facilitated the comparison of behavioral patterns across
customer groups without the need for complex machine learning algorithms, making it suitable for an
exploratory, interpretable analysis.
Feature Engineering
To enhance the granularity of the segmentation, two engineered features were introduced:
• Spending Level: Customers were classified into three tiers—Low Spender (monthly charges
below \$35), Medium Spender (between \$35 and \$65), and High Spender (above \$65)—based
on the distribution of the MonthlyCharges column. This categorization enables revenue-based
segmentation.
• Tenure Group: Customers were assigned to tenure-based groups—New Customer (0–12 months),
Mid-Term Customer (13–36 months), and Loyal Customer (37+ months)—reflecting the depth of
their relationship with the service provider. This dimension is particularly relevant for churn
analysis and loyalty program design.
8
IMPLEMENTATION
Tools and Technologies
The implementation was carried out using the following tools and libraries:
• Python 3.x: The primary programming language used for all data processing and visualization
tasks.
• Pandas: Employed for data loading, cleaning, type conversion, grouping, and aggregation
operations.
• Matplotlib: Utilized for generating bar charts and pie charts to visualize segment distributions.
Implementation Steps
The implementation followed a structured pipeline consisting of four major stages. In the data loading
stage, the dataset was read into a Pandas DataFrame using the read_csv function. The data cleaning stage
involved converting the TotalCharges column from string to float, replacing empty string values with
NaN, and dropping affected rows. The feature engineering stage introduced the SpendingLevel and
TenureGroup categorical columns based on conditional binning of MonthlyCharges and tenure,
respectively. Finally, the visualization stage produced multiple charts to illustrate the distribution and
relationships of customer segments.
Segmentation Categories
The segmentation analysis was performed across four principal dimensions:
• Contract Type Segmentation: Customers were grouped by their contract type (Month-to-Month,
One Year, Two Year) to understand the prevalence of each contract and its relationship with churn
behavior.
• Churn Segmentation: The customer base was divided into churned and retained segments,
allowing the identification of the characteristics most associated with customer departure.
• Spending Level Segmentation: The three-tier classification (Low, Medium, High) of monthly
charges allowed the identification of high-value customers and enabled revenue-focused business
strategies.
• Tenure Group Segmentation: New, Mid-Term, and Loyal customer categories were analyzed to
reveal patterns in customer loyalty and to identify which tenure groups have the highest
propensity to churn.
CODE USED:
import pandas as pd
import [Link] as plt
import os
print("Files in /content folder:")
print([Link]('/content'))
df = pd.read_csv("/content/telecom_data.csv")
9
print("\nDataset Loaded Successfully!\n")
print([Link]())
# Remove duplicates
df.drop_duplicates(inplace=True)
# Convert TotalCharges to numeric
df['TotalCharges'] = pd.to_numeric(df['TotalCharges'],
errors='coerce')
# Fill missing values
[Link](method='ffill', inplace=True)
# Convert SeniorCitizen to categorical
df['SeniorCitizen'] = df['SeniorCitizen'].map({0: 'No', 1: 'Yes'})
# Contract Segmentation
contract_group = [Link]("Contract").size()
# Churn Segmentation
churn_group = [Link]("Churn").size()
# Spending Segmentation
df['Spending_Level'] = [Link](df['MonthlyCharges'],
bins=[0, 35, 70, 120],
labels=['Low', 'Medium', 'High'])
spending_group = [Link]("Spending_Level").size()
# Tenure Segmentation
df['Tenure_Group'] = [Link](df['tenure'],
bins=[0, 12, 36, 72],
labels=['New', 'Regular', 'Loyal'])
tenure_group = [Link]("Tenure_Group").size()
print("\nContract Distribution:\n", contract_group)
print("\nChurn Distribution:\n", churn_group)
print("\nSpending Segmentation:\n", spending_group)
print("\nTenure Segmentation:\n", tenure_group)
[Link]()
contract_group.plot(kind='bar')
[Link]("Customers by Contract Type")
[Link]("Contract Type")
[Link]("Number of Customers")
10
[Link](rotation=45)
[Link]()
[Link]()
contract_group.plot(kind='pie', autopct='%1.1f%%')
[Link]("Contract Type Distribution")
[Link]("")
[Link]()
[Link]()
churn_group.plot(kind='bar')
[Link]("Churn Distribution")
[Link]("Churn")
[Link]("Number of Customers")
[Link]()
[Link]()
churn_group.plot(kind='pie', autopct='%1.1f%%')
[Link]("Churn Percentage")
[Link]("")
[Link]()
# ---- SPENDING ----
[Link]()
spending_group.plot(kind='bar')
[Link]("Customer Spending Segmentation")
[Link]("Spending Level")
[Link]("Number of Customers")
[Link]()
[Link]()
spending_group.plot(kind='pie', autopct='%1.1f%%')
[Link]("Spending Distribution")
[Link]("")
[Link]()
# ---- TENURE ----
[Link]()
tenure_group.plot(kind='bar')
[Link]("Customer Loyalty (Tenure)")
[Link]("Tenure Group")
[Link]("Number of Customers")
11
[Link]()
[Link]()
tenure_group.plot(kind='pie', autopct='%1.1f%%')
[Link]("Tenure Distribution")
[Link]("")
[Link]()
churn_contract = [Link](df['Contract'], df['Churn'])
churn_contract.plot(kind='bar')
[Link]("Churn vs Contract Type")
[Link]("Contract Type")
[Link]("Number of Customers")
[Link]()
print("Most common contract:", contract_group.idxmax())
print("Major churn category:", churn_group.idxmax())
print("Highest spending group:", spending_group.idxmax())
print("Most customers belong to:", tenure_group.idxmax())
12
RESULTS :
Visualizations
The implementation produced a series of visualizations that illustrate the distribution and characteristics
of each customer segment. Grouped bar charts were used to compare average monthly charges and churn
counts across contract types, while pie charts depicted the proportional distribution of customer segments
within spending levels and tenure groups. These visual outputs provided an intuitive understanding of the
data that would otherwise be difficult to interpret from raw tabular form.
Key Findings
The analysis yielded the following significant findings:
• Most Common Contract Type: The Month-to-Month contract type was found to be the most
prevalent, accounting for the largest proportion of the customer base. This contract type also
exhibited a substantially higher churn rate compared to annual or biannual contracts, suggesting
that longer-term commitments are associated with greater customer loyalty.
• Churn Distribution: Approximately 26–27% of customers in the dataset had churned. Churned
customers showed a notably higher average monthly charge compared to retained customers,
indicating that dissatisfaction with billing may be a significant driver of attrition.
• High-Value Customers: The High Spender segment, defined by monthly charges above \$65,
constituted a minority of the total customer base but represented a disproportionately high share of
total revenue. These customers tended to have fiber optic services and add-on subscriptions.
• Loyal Customers: Customers with a tenure exceeding 36 months were categorized as Loyal
Customers. This segment demonstrated the lowest churn rate of all tenure groups, confirming the
widely held view that customer longevity is a strong predictor of retention. Notably, loyal
customers were more likely to hold One Year or Two Year contracts.
13
OUTPUT:
14
15
DATASET
16
CONCLUSION
This project successfully demonstrated the application of data science techniques to perform meaningful
customer segmentation in the telecom domain. By preprocessing the dataset, engineering relevant
features, and grouping customers along dimensions of contract type, churn behavior, spending level, and
tenure, the analysis revealed clear and actionable patterns within the customer base.
The findings have direct business implications. The high churn rate among Month-to-Month contract
holders suggests that telecom providers should design incentive programs to encourage customers to
migrate to longer-term plans. The identification of High Spender and Loyal Customer segments enables
targeted marketing campaigns that reward high-value customers and strengthen long-term relationships.
Furthermore, the analysis of churned customers’ characteristics provides a foundation for developing
predictive churn models in future work.
In conclusion, customer segmentation is a cost-effective and interpretable approach to data-driven
decision-making in the telecommunications industry. The methodology and insights presented in this
report offer a replicable framework that can be scaled and extended with advanced machine learning
algorithms, such as K-Means clustering or hierarchical clustering, to achieve even finer-grained
segmentation in production environments.
17
REFERENCES
[1] I. Jolliffe and J. Cadima, “Principal component analysis: A
review and recent developments,” Philosophical Transactions of the
Royal Society A, vol. 374, no. 2065, pp. 1–16, 2016. [Online].
Available: [Link]
[2] A. Lalwani and S. Sharma, “Customer segmentation using K-
means clustering in the telecom sector,” International Journal of
Advanced Research in Computer Science, vol. 8, no. 3, pp. 512–518,
2017.
[3] IBM Watson Analytics, “Telco Customer Churn Dataset,”
Kaggle, 2019. [Online]. Available:
[Link] [Accessed:
Apr. 2025].
18
Python For Data Science
Duration: 8 Weeks
Course Contents
Week 1
Introduction to Python
Introduction to Spyder
Setting working Directory
Creating and saving a script file
File execution, clearing console, removing variables from environment,
Clearing environment
Commenting script files
Variable creation
Arithmetic and logical operators
Data types and associated operations
Week 2
Sequence data types and associated operations: strings, lists, arrays,
tuples, dictionary, sets, range
NumPy
Week 3
Pandas dataframe and dataframe related operations on Toyota Corolla
dataset
Data visualization on Toyota Corolla dataset using matplotlib and
seaborn libraries
Control structures using Toyota Corolla dataset
Function
19
Week 4
Case study
Regression – Predicting price of pre-owned cars
Classification – Classifying personal income
Course Outcome
• Apply basic concepts of Python Programming
• Ability to solve problems with Python
• Basic understanding of basic Python concepts like operators, strings,
dictionaries, tuple, functions, dataframe, file handling, classes, and
objects etc.
• Implement python programs - sorting algorithms, binary search trees
• Basic understanding of data analysis concepts like regression,
classification
20
Certificate
21