Skip to content

Dataset Guide — IPL Sports Analytics

Source

Dataset: IPL Complete Dataset (2008–2020+) URL: https://www.kaggle.com/datasets/patrickb1912/ipl-complete-dataset-20082020 Files: matches.csv and deliveries.csv


File 1 — matches.csv (~1,000 rows, one per match)

Column Type Description
id int Unique match ID (joins to deliveries.match_id)
season int/str IPL season year
city str Host city
date date Match date
team1 / team2 str The two teams
toss_winner str Team that won the toss
toss_decision str "bat" or "field"
winner str Match winner (NULL if no result)
result str "normal", "tie", "no result"
result_margin float Win margin (runs or wickets)
venue str Stadium name
player_of_match str Man of the match

File 2 — deliveries.csv (~250,000 rows, one per ball)

Column Type Description
match_id int Joins to matches.id
inning int 1 or 2 (which team is batting)
batting_team str Team batting
bowling_team str Team bowling
over int Over number (0-19)
ball int Ball within the over (1-6, more if extras)
batter str Batsman on strike
bowler str Bowler
non_striker str Batsman at non-striker end
batsman_runs int Runs scored off the bat
extra_runs int Extras (wide, no-ball, bye, leg-bye)
total_runs int batsman_runs + extra_runs
extras_type str Type of extra (NULL if none)
is_wicket int 1 if a wicket fell on this ball
player_dismissed str Who got out (NULL if no wicket)
dismissal_kind str bowled, caught, lbw, run out, etc.
fielder str Fielder involved in dismissal

Cricket Terminology Cheat Sheet

Term Meaning Formula
Run Point scored
Wicket Batsman dismissed
Over 6 legal balls
Strike Rate (batting) Runs per 100 balls runs / balls × 100
Batting Average Runs per dismissal runs / times out
Economy Rate (bowling) Runs conceded per over runs conceded / overs bowled
Bowling Strike Rate Balls per wicket balls bowled / wickets
Powerplay Overs 1-6 (fielding restrictions) over < 6
Death overs Overs 16-20 (end of innings) over >= 15
Extras Runs not off the bat wides, no-balls, byes, leg-byes

Key Data Logic to Understand

Balls faced ≠ total deliveries

Wides and no-balls don't count as "balls faced" by the batsman. When calculating strike rate, exclude deliveries where extras_type IN ('wides', 'noballs').

Runs off the bat vs total runs

A batsman's runs = SUM(batsman_runs). Extras (extra_runs) are credited to the team, not the batsman. A bowler's runs conceded includes wides and no-balls but NOT byes/leg-byes (those aren't the bowler's fault).

Team name changes over seasons

Some teams changed names (Delhi Daredevils → Delhi Capitals, Kings XI Punjab → Punjab Kings). Standardise these during cleaning if doing multi-season analysis.


Quick Exploration

import pandas as pd

matches = pd.read_csv("matches.csv")
deliveries = pd.read_csv("deliveries.csv")

print(f"Matches: {len(matches)}, Deliveries: {len(deliveries)}")

# Top run scorers
top_batters = (
    deliveries.groupby("batter")["batsman_runs"].sum()
    .sort_values(ascending=False).head(5)
)
print(top_batters)

# Toss decision split
print(matches["toss_decision"].value_counts(normalize=True))

← Business Problem · Next: Data Cleaning →