SAMANTUS Python for Data Analytics — Complete Training Manual CAPSTONE PROJECT 03
← Back to Course Index

IPL Data Analysis


On This Page

Capstone Project 3: IPL Data Analysis


C3.1  Project Overview

This project analyzes 10 seasons of IPL (Indian Premier League) cricket data to uncover team performance trends and scoring patterns — a fun, highly relatable dataset that's excellent for building an engaging analytics portfolio piece.

ℹ Note
This project uses illustrative sample data for teaching purposes. For a real project, students should source an actual IPL ball-by-ball dataset (widely available on Kaggle).

C3.2  Business Problem

A sports analytics firm wants to identify which teams have historically performed best, and whether scoring patterns across seasons reveal any meaningful trends for broadcasters and fantasy-league platforms.

C3.3  Dataset Description

ColumnDescription
seasonIPL season year
teamTeam name
match_resultWin/Loss for each match
first_innings_scoreScore posted batting first
venueStadium where the match was played

Sample scope: 10 seasons (2016-2025) of match-level summary data.

C3.4  Objectives


C3.5  Step-by-Step Solution

C3.6  Complete Python Code

► ipl_analysis.py
import pandas as pd
import matplotlib.pyplot as plt

# 1. Load data
df = pd.read_csv("ipl_matches.csv")

# 2. Clean team names
df['team'] = df['team'].replace({'Delhi Daredevils': 'Delhi Capitals'})

# 3. Titles won per team
titles = df[df['match_result']=='Final Win'].groupby('team').size().sort_values(ascending=False)
print("Titles Won by Team:\n", titles)

# 4. Average score per season
avg_score_by_season = df.groupby('season')['first_innings_score'].mean()
print("Average 1st Innings Score by Season:\n", avg_score_by_season.round(1))

# 5. Visualize
titles.plot(kind="barh", title="Titles Won by Team")
plt.savefig("titles_chart.png")

C3.7  Expected Output

Output
Titles Won by Team:
Mumbai Indians    5
Chennai Super Kings   5
Kolkata Knight Riders  2
Gujarat Titans      1

C3.8  Visualizations

Figure C3.1 — IPL titles won per team (sample data).
Figure C3.1 — IPL titles won per team (sample data).
Figure C3.2 — Average first-innings score trend across 10 seasons.
Figure C3.2 — Average first-innings score trend across 10 seasons.

C3.9  Key Insights

C3.10  Business Recommendations

✓ Instructor Tip
Sports datasets like this one are a great way to keep less analytically-inclined students engaged — consider offering it as an optional alternate project alongside the business-focused ones.